exiftool-vendored
Advanced tools
Comparing version 22.1.0 to 22.2.0
@@ -29,2 +29,8 @@ # Changelog/Versioning | ||
### v22.2.0 | ||
- ✨ Add support for zone extraction from `ExifDateTime`, `ExifTime`, `number[]`, and `number` fields. | ||
- 📦 Improve type signature of `extractTzOffsetFromTags`. | ||
### v22.1.0 | ||
@@ -45,9 +51,9 @@ | ||
- 🐞 Fix exports for DefaultExifToolOptions and several other non-type values. Thanks for the [bug report, renambot!](https://github.com/photostructure/exiftool-vendored.js/issues/144) | ||
### v21.5.1 | ||
- 📦 Avoid double-rendering of ImageDataMD5 (Thanks, Phil! See [forum post for details](https://exiftool.org/forum/index.php?topic=14706.msg79218#msg79218)) | ||
- 📦 Pull down new camera test images, rebuild Tags and docs | ||
- 📦 Pull down new camera test images, rebuild Tags and docs | ||
### v21.5.0 | ||
@@ -54,0 +60,0 @@ |
@@ -5,6 +5,6 @@ import { ExifToolTask } from "./ExifToolTask"; | ||
export declare const DefaultReadTaskOptions: { | ||
readonly includeImageDataMD5: boolean | undefined; | ||
readonly imageHashType: false | "MD5" | "SHA256" | "SHA512"; | ||
readonly useMWG: boolean; | ||
readonly numericTags: string[]; | ||
readonly imageHashType: false | "MD5" | "SHA256" | "SHA512"; | ||
readonly includeImageDataMD5: boolean | undefined; | ||
readonly defaultVideosToUTC: boolean; | ||
@@ -11,0 +11,0 @@ readonly backfillTimezones: boolean; |
import { Zone } from "luxon"; | ||
import { ExifDateTime } from "./ExifDateTime"; | ||
import { ExifTime } from "./ExifTime"; | ||
import { ExifToolOptions } from "./ExifToolOptions"; | ||
import { Maybe } from "./Maybe"; | ||
import { Tags } from "./Tags"; | ||
export declare const MaxTzOffsetHours = 14; | ||
@@ -37,6 +40,6 @@ /** | ||
*/ | ||
export declare function extractOffset(tz: Maybe<string>): Maybe<TzSrc>; | ||
export declare function extractOffset(value: Maybe<string | number | number[] | ExifDateTime | ExifTime>): Maybe<TzSrc>; | ||
declare const TimezoneOffsetTagnames: readonly ["TimeZone", "OffsetTime", "OffsetTimeOriginal", "OffsetTimeDigitized", "TimeZoneOffset"]; | ||
declare const CreateDateTagnames: readonly ["SubSecCreateDate", "CreateDate", "SubSecDateTimeOriginal", "DateTimeOriginal", "SubSecMediaCreateDate", "MediaCreateDate", "CreationDate", "TimeCreated"]; | ||
export declare function extractTzOffsetFromTags(t: Partial<Record<(typeof TimezoneOffsetTagnames)[number] | (typeof CreateDateTagnames)[number], string>>, opts?: Partial<Pick<ExifToolOptions, "inferTimezoneFromDatestamps">>): Maybe<TzSrc>; | ||
export declare function extractTzOffsetFromTags(t: Pick<Tags, (typeof TimezoneOffsetTagnames)[number] | (typeof CreateDateTagnames)[number]>, opts?: Partial<Pick<ExifToolOptions, "inferTimezoneFromDatestamps">>): Maybe<TzSrc>; | ||
export declare function inferLikelyOffsetMinutes(deltaMinutes: number): number; | ||
@@ -43,0 +46,0 @@ export declare function extractTzOffsetFromUTCOffset(t: { |
@@ -79,19 +79,36 @@ "use strict"; | ||
const timestampTzRe = /(?<sign>[+-])(?<hours>\d\d?):(?<minutes>\d\d)$/; | ||
function extractOffsetFromHours(hourOffset) { | ||
return (0, Number_1.isNumber)(hourOffset) | ||
? (0, Maybe_1.map)(tzHourToOffset(hourOffset), (tz) => ({ | ||
tz, | ||
src: "hourOffset", | ||
})) | ||
: Array.isArray(hourOffset) | ||
? extractOffsetFromHours(hourOffset[0]) | ||
: undefined; | ||
} | ||
/** | ||
* Parse a timezone offset and return the offset minutes | ||
*/ | ||
function extractOffset(tz) { | ||
var _a, _b, _c, _d; | ||
if (tz == null || (0, String_1.blank)(tz)) { | ||
return undefined; | ||
function extractOffset(value) { | ||
var _a, _b, _c, _d, _e; | ||
if (value instanceof ExifDateTime_1.ExifDateTime) { | ||
return (0, Maybe_1.map)(value.zone, (tz) => ({ tz, src: "ExifDateTime" })); | ||
} | ||
if ((0, String_1.isString)(tz) && luxon_1.Info.isValidIANAZone(tz)) { | ||
return { tz, src: "validIANAZone" }; | ||
if ((0, Number_1.isNumber)(value) || Array.isArray(value)) { | ||
return extractOffsetFromHours(value); | ||
} | ||
if ((0, String_1.isString)(value) && luxon_1.Info.isValidIANAZone(value)) { | ||
return { tz: value, src: "validIANAZone" }; | ||
} | ||
// ExifTime will have a rawValue, but doesn't support zone extraction: | ||
const str = (_a = value.rawValue) !== null && _a !== void 0 ? _a : (0, String_1.toS)(value); | ||
if ((0, String_1.blank)(str)) | ||
return; | ||
for (const g of (0, Array_1.compact)([ | ||
(_a = utcTzRe.exec(tz)) === null || _a === void 0 ? void 0 : _a.groups, | ||
(_b = timestampTzRe.exec(tz)) === null || _b === void 0 ? void 0 : _b.groups, | ||
(_b = utcTzRe.exec(str)) === null || _b === void 0 ? void 0 : _b.groups, | ||
(_c = timestampTzRe.exec(str)) === null || _c === void 0 ? void 0 : _c.groups, | ||
])) { | ||
const tz = offsetMinutesToZoneName((g.sign === "-" ? -1 : 1) * | ||
(parseInt((_c = g.hours) !== null && _c !== void 0 ? _c : "0") * 60 + parseInt((_d = g.minutes) !== null && _d !== void 0 ? _d : "0"))); | ||
(parseInt((_d = g.hours) !== null && _d !== void 0 ? _d : "0") * 60 + parseInt((_e = g.minutes) !== null && _e !== void 0 ? _e : "0"))); | ||
if (tz != null) | ||
@@ -98,0 +115,0 @@ return { tz, src: "offsetMinutesToZoneName" }; |
{ | ||
"name": "exiftool-vendored", | ||
"version": "22.1.0", | ||
"version": "22.2.0", | ||
"description": "Efficient, cross-platform access to ExifTool", | ||
@@ -69,4 +69,4 @@ "main": "./dist/ExifTool.js", | ||
"devDependencies": { | ||
"@types/chai": "^4.3.5", | ||
"@types/chai-as-promised": "^7.1.5", | ||
"@types/chai": "^4.3.6", | ||
"@types/chai-as-promised": "^7.1.6", | ||
"@types/chai-subset": "^1.3.3", | ||
@@ -80,4 +80,4 @@ "@types/globule": "^1.1.6", | ||
"@types/xmldom": "^0.1.32", | ||
"@typescript-eslint/eslint-plugin": "^6.5.0", | ||
"@typescript-eslint/parser": "^6.5.0", | ||
"@typescript-eslint/eslint-plugin": "^6.6.0", | ||
"@typescript-eslint/parser": "^6.6.0", | ||
"@xmldom/xmldom": "^0.8.10", | ||
@@ -102,3 +102,3 @@ "chai": "^4.3.8", | ||
"tmp": "^0.2.1", | ||
"typedoc": "^0.25.0", | ||
"typedoc": "^0.25.1", | ||
"typescript": "^5.2.2", | ||
@@ -105,0 +105,0 @@ "xpath": "^0.0.33" |
@@ -291,11 +291,2 @@ # exiftool-vendored | ||
## This package requires `procps`. | ||
The default `BatchClusterOptions.cleanupChildProcs` value of `true` means that BatchCluster, which is used to manage child `exiftool` processes, will try to use `ps` to ensure Node's view of process state are correct, and that errant | ||
processes are cleaned up. | ||
If you run this in a docker image based on Alpine or Debian Slim, **this won't work properly unless you install the `procps` package.** | ||
[See `batch-cluster` for details.](https://github.com/photostructure/batch-cluster.js/issues/13) | ||
## Resource hygiene | ||
@@ -302,0 +293,0 @@ |
Sorry, the diff of this file is not supported yet
487566
8399
467