exiftool-vendored 21.4.0 → 21.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -25,6 +25,21 @@ vendored versions of ExifTool match the version that they vendor.
25
25
 
26
26
  ## Version history
27
27
 
28
+ ### v21.5.1
29
+
30
+ - 📦 Avoid double-rendering of ImageDataMD5 (Thanks, Phil! See [forum post for details](https://exiftool.org/forum/index.php?topic=14706.msg79218#msg79218))
31
+
32
+ - 📦 Pull down new camera test images, rebuild Tags and docs
33
+
34
+ ### v21.5.0
35
+
36
+ - ✨ Added support for ExifTool's [MWG Composite Tags](https://exiftool.org/TagNames/MWG.html). Set the new [`ExifToolOptions.useMWG`](https://photostructure.github.io/exiftool-vendored.js/interfaces/ExifToolOptions.html#useMWG) option to `true` to enable.
37
+
38
+ - ✨ Added support for ExifTool's new `ImageDataMD5` feature. Set the new [`ExifToolOptions.includeImageDataMD5`](https://photostructure.github.io/exiftool-vendored.js/interfaces/ExifToolOptions.html#includeImageDataMD5) option to `true` to enable.
39
+
40
+ - 📦 Extracted options-related code into modules to remove a couple circular
41
+ dependencies. Exports should make this transparent to external clients.
42
+
28
43
  ### v21.4.0
29
44
 
30
45
  - 🐞 Improved types from `ExifTool.readRaw()`. Thanks for the suggestion, [Silvio Brändle](https://github.com/photostructure/exiftool-vendored.js/issues/138)!
@@ -0,0 +1,7 @@
1
+ import { ExifToolOptions } from "./ExifToolOptions";
2
+ import { Omit } from "./Omit";
3
+ /**
4
+ * Default values for `ExifToolOptions`, except for `processFactory` (which is
5
+ * created by the ExifTool constructor)
6
+ */
7
+ export declare const DefaultExifToolOptions: Omit<ExifToolOptions, "processFactory" | "ignoreShebang">;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DefaultExifToolOptions = void 0;
27
+ const bc = __importStar(require("batch-cluster"));
28
+ const DefaultExiftoolArgs_1 = require("./DefaultExiftoolArgs");
29
+ const DefaultMaxProcs_1 = require("./DefaultMaxProcs");
30
+ const FindExiftool_1 = require("./FindExiftool");
31
+ const GeoTz_1 = require("./GeoTz");
32
+ const IgnorableError_1 = require("./IgnorableError");
33
+ const VersionTask_1 = require("./VersionTask");
34
+ /**
35
+ * Default values for `ExifToolOptions`, except for `processFactory` (which is
36
+ * created by the ExifTool constructor)
37
+ */
38
+ exports.DefaultExifToolOptions = Object.freeze({
39
+ ...new bc.BatchClusterOptions(),
40
+ maxProcs: DefaultMaxProcs_1.DefaultMaxProcs,
41
+ maxTasksPerProcess: 500,
42
+ spawnTimeoutMillis: 30000,
43
+ // see https://github.com/photostructure/exiftool-vendored.js/issues/34 :
44
+ taskTimeoutMillis: 20000,
45
+ onIdleIntervalMillis: 2000,
46
+ taskRetries: 1,
47
+ exiftoolPath: FindExiftool_1.DefaultExifToolPath,
48
+ exiftoolArgs: DefaultExiftoolArgs_1.DefaultExiftoolArgs,
49
+ exiftoolEnv: {},
50
+ pass: "{ready}",
51
+ fail: "{ready}",
52
+ exitCommand: "-stay_open\nFalse\n",
53
+ versionCommand: new VersionTask_1.VersionTask().command,
54
+ healthCheckIntervalMillis: 30000,
55
+ healthCheckCommand: "-ver\n-execute\n",
56
+ useMWG: false,
57
+ numericTags: [
58
+ "*Duration*",
59
+ "GPSAltitude",
60
+ "GPSLatitude",
61
+ "GPSLongitude",
62
+ "GPSPosition",
63
+ "Orientation",
64
+ ],
65
+ includeImageDataMD5: false,
66
+ defaultVideosToUTC: true,
67
+ geoTz: GeoTz_1.geoTz,
68
+ isIgnorableError: IgnorableError_1.isIgnorableWarning,
69
+ });
70
+ //# sourceMappingURL=DefaultExifToolOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultExifToolOptions.js","sourceRoot":"","sources":["../src/DefaultExifToolOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,+DAA2D;AAC3D,uDAAmD;AAEnD,iDAAoD;AACpD,mCAA+B;AAC/B,qDAAqD;AAErD,+CAA2C;AAE3C;;;GAGG;AAEU,QAAA,sBAAsB,GAG/B,MAAM,CAAC,MAAM,CAAC;IAChB,GAAG,IAAI,EAAE,CAAC,mBAAmB,EAAE;IAC/B,QAAQ,EAAE,iCAAe;IACzB,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,KAAK;IACzB,yEAAyE;IACzE,iBAAiB,EAAE,KAAK;IACxB,oBAAoB,EAAE,IAAI;IAC1B,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,kCAAmB;IACjC,YAAY,EAAE,yCAAmB;IACjC,WAAW,EAAE,EAAE;IACf,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,qBAAqB;IAClC,cAAc,EAAE,IAAI,yBAAW,EAAE,CAAC,OAAO;IACzC,yBAAyB,EAAE,KAAK;IAChC,kBAAkB,EAAE,kBAAkB;IACtC,MAAM,EAAE,KAAK;IACb,WAAW,EAAE;QACX,YAAY;QACZ,aAAa;QACb,aAAa;QACb,cAAc;QACd,aAAa;QACb,aAAa;KACd;IACD,mBAAmB,EAAE,KAAK;IAC1B,kBAAkB,EAAE,IAAI;IACxB,KAAK,EAAE,aAAK;IACZ,gBAAgB,EAAE,mCAAkB;CACrC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const DefaultExiftoolArgs: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultExiftoolArgs = void 0;
4
+ exports.DefaultExiftoolArgs = ["-stay_open", "True", "-@", "-"];
5
+ //# sourceMappingURL=DefaultExiftoolArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultExiftoolArgs.js","sourceRoot":"","sources":["../src/DefaultExiftoolArgs.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const DefaultMaxProcs: number;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DefaultMaxProcs = void 0;
27
+ const _os = __importStar(require("os"));
28
+ exports.DefaultMaxProcs = Math.max(1, Math.floor(_os.cpus().length / 4));
29
+ //# sourceMappingURL=DefaultMaxProcs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultMaxProcs.js","sourceRoot":"","sources":["../src/DefaultMaxProcs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyB;AAEZ,QAAA,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA"}
@@ -1,6 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import * as bc from "batch-cluster";
3
3
  import { ApplicationRecordTags } from "./ApplicationRecordTags";
4
+ import { DefaultExiftoolArgs } from "./DefaultExiftoolArgs";
5
+ import { DefaultExifToolOptions } from "./DefaultExifToolOptions";
6
+ import { DefaultMaxProcs } from "./DefaultMaxProcs";
4
7
  import { ExifDate } from "./ExifDate";
5
8
  import { ExifDateTime } from "./ExifDateTime";
6
9
  import { ExifToolOptions } from "./ExifToolOptions";
@@ -10,11 +13,14 @@ import { IgnorableError } from "./IgnorableError";
10
13
  import { Maybe } from "./Maybe";
11
14
  import { Omit } from "./Omit";
12
15
  import { PreviewTag } from "./PreviewTag";
13
- import { RawTags } from "./RawTags";
16
+ import { Json, Literal, RawTags } from "./RawTags";
17
+ import { DefaultReadTaskOptions, ReadTaskOptions } from "./ReadTask";
14
18
  import { ResourceEvent } from "./ResourceEvent";
15
19
  import { Struct } from "./Struct";
16
- import { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, CompositeTags, EXIFTags, ExifToolTags, FileTags, FlashPixTags, IPTCTags, JFIFTags, MPFTags, MakerNotesTags, MetaTags, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RIFFTags, Tags, XMPTags } from "./Tags";
20
+ import { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, CompositeTags, EXIFTags, ExifToolTags, FileTags, FlashPixTags, IPTCTags, JFIFTags, MakerNotesTags, MetaTags, MPFTags, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RIFFTags, Tags, XMPTags } from "./Tags";
17
21
  import { Version } from "./Version";
22
+ import { WriteTags } from "./WriteTags";
23
+ import { DefaultWriteTaskOptions, WriteTaskOptions } from "./WriteTask";
18
24
  export { BinaryField } from "./BinaryField";
19
25
  export { ExifDate } from "./ExifDate";
20
26
  export { ExifDateTime } from "./ExifDateTime";
@@ -22,10 +28,8 @@ export { ExifTime } from "./ExifTime";
22
28
  export { ExifToolTask } from "./ExifToolTask";
23
29
  export { isIgnorableWarning } from "./IgnorableError";
24
30
  export { parseJSON } from "./JSON";
25
- export { UnsetZone, UnsetZoneName, UnsetZoneOffsetMinutes, defaultVideosToUTC, offsetMinutesToZoneName, } from "./Timezones";
26
- export type { AdditionalWriteTags, APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, ApplicationRecordTags, CompositeTags, EXIFTags, ExifToolOptions, ExifToolTags, ExpandedDateTags, FileTags, FlashPixTags, ICCProfileTags, IgnorableError, IPTCTags, JFIFTags, MakerNotesTags, Maybe, MetaTags, MPFTags, Omit, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RawTags, ResourceEvent, RIFFTags, Struct, Tags, Version, XMPTags, };
27
- export declare const DefaultExifToolPath: string;
28
- export declare const DefaultExiftoolArgs: string[];
31
+ export { defaultVideosToUTC, offsetMinutesToZoneName, UnsetZone, UnsetZoneName, UnsetZoneOffsetMinutes, } from "./Timezones";
32
+ export type { AdditionalWriteTags, APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, ApplicationRecordTags, CompositeTags, DefaultExiftoolArgs, DefaultExifToolOptions, DefaultMaxProcs, DefaultReadTaskOptions, DefaultWriteTaskOptions, EXIFTags, ExifToolOptions, ExifToolTags, ExpandedDateTags, FileTags, FlashPixTags, ICCProfileTags, IgnorableError, IPTCTags, JFIFTags, Json, Literal, MakerNotesTags, Maybe, MetaTags, MPFTags, Omit, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RawTags, ReadTaskOptions, ResourceEvent, RIFFTags, Struct, Tags, Version, WriteTags, WriteTaskOptions, XMPTags, };
29
33
  /**
30
34
  * @see https://exiftool.org/TagNames/Shortcuts.html
31
35
  */
@@ -58,13 +62,6 @@ export interface StructAppendTags {
58
62
  */
59
63
  "Versions+"?: Version | Version[];
60
64
  }
61
- export type WriteTags = DefinedOrNullValued<ShortcutTags & AdditionalWriteTags & ExpandedDateTags & StructAppendTags>;
62
- export declare const DefaultMaxProcs: number;
63
- /**
64
- * Default values for `ExifToolOptions`, except for `processFactory` (which is
65
- * created by the ExifTool constructor)
66
- */
67
- export declare const DefaultExifToolOptions: Omit<ExifToolOptions, "processFactory" | "ignoreShebang">;
68
65
  /**
69
66
  * Manages delegating calls to a vendored running instance of ExifTool.
70
67
  *
@@ -87,37 +84,43 @@ export declare class ExifTool {
87
84
  * Read the tags in `file`.
88
85
  *
89
86
  * @param {string} file the file to extract metadata tags from
90
- * @param {string[]} [optionalArgs] any additional ExifTool arguments, like "-fast" or
91
- * "-fast2". **Most other arguments will require you to use `readRaw`.**
92
- * Note that the default is "-fast", so if you want ExifTool to read the
93
- * entire file for metadata, you should pass an empty array as the second
94
- * parameter. See https://exiftool.org/#performance for
95
- * more information about `-fast` and `-fast2`.
87
+ *
88
+ * @param {string[]} [optionalArgs] any additional ExifTool arguments, like
89
+ * "-fast" or "-fast2". **Most other arguments will require you to use
90
+ * `readRaw`.** Note that the default is "-fast", so if you want ExifTool to
91
+ * read the entire file for metadata, you should pass an empty array as the
92
+ * second parameter. See https://exiftool.org/#performance for more
93
+ * information about `-fast` and `-fast2`.
94
+ *
96
95
  * @returns {Promise<Tags>} A resolved Tags promise. If there are errors
97
96
  * during reading, the `.errors` field will be present.
98
- * @memberof ExifTool
99
97
  */
100
- read<T extends Tags = Tags>(file: string, optionalArgs?: string[]): Promise<T>;
98
+ read<T extends Tags = Tags>(file: string, optionalArgs?: string[], options?: ReadTaskOptions): Promise<T>;
101
99
  /**
102
- * Read the tags from `file`, without any post-processing of ExifTool values.
100
+ * Read the tags from `file`, without any post-processing of ExifTool
101
+ * values.
103
102
  *
104
- * **You probably want `read`, not this method. READ THE REST OF THIS COMMENT
105
- * CAREFULLY.**
103
+ * **You probably want `read`, not this method. READ THE REST OF THIS
104
+ * COMMENT CAREFULLY.**
106
105
  *
107
- * If you want to extract specific tag values from a file, you may want to use
108
- * this, but all data validation and inference heuristics provided by `read`
109
- * will be skipped.
106
+ * If you want to extract specific tag values from a file, you may want to
107
+ * use this, but all data validation and inference heuristics provided by
108
+ * `read` will be skipped.
110
109
  *
111
- * Note that performance will be very similar to `read`, and will actually be
112
- * worse if you don't include `-fast` or `-fast2` (as the most expensive bit
113
- * is the perl interpreter and scanning the file on disk).
110
+ * Note that performance will be very similar to `read`, and will actually
111
+ * be worse if you don't include `-fast` or `-fast2` (as the most expensive
112
+ * bit is the perl interpreter and scanning the file on disk).
114
113
  *
115
- * @param args any additional arguments other than the file path. Note that "-json", and the Windows unicode filename handler flags, "-charset filename=utf8", will be added automatically.
114
+ * @param args any additional arguments other than the file path. Note that
115
+ * "-json", and the Windows unicode filename handler flags, "-charset
116
+ * filename=utf8", will be added automatically.
116
117
  *
117
118
  * @return Note that the return value will be similar to `Tags`, but with no
118
- * date, time, or other rich type parsing that you get from `.read()`. The field values will be `string | number | string[]`.
119
+ * date, time, or other rich type parsing that you get from `.read()`. The
120
+ * field values will be `string | number | string[]`.
119
121
  *
120
- * @see https://github.com/photostructure/exiftool-vendored.js/issues/44
122
+ * @see https://github.com/photostructure/exiftool-vendored.js/issues/44 for
123
+ * typing details.
121
124
  */
122
125
  readRaw(file: string, args?: string[]): Promise<RawTags>;
123
126
  /**
@@ -132,7 +135,7 @@ export declare class ExifTool {
132
135
  * there are errors or warnings.
133
136
  * @memberof ExifTool
134
137
  */
135
- write(file: string, tags: WriteTags, args?: string[]): Promise<void>;
138
+ write(file: string, tags: WriteTags, args?: string[], options?: WriteTaskOptions): Promise<void>;
136
139
  /**
137
140
  * This will strip `file` of all metadata tags. The original file (with the
138
141
  * name `${FILENAME}_original`) will be retained. Note that some tags, like
package/dist/ExifTool.js CHANGED
@@ -26,21 +26,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.exiftool = exports.ExifTool = exports.DefaultExifToolOptions = exports.DefaultMaxProcs = exports.DefaultExiftoolArgs = exports.DefaultExifToolPath = exports.offsetMinutesToZoneName = exports.defaultVideosToUTC = exports.UnsetZoneOffsetMinutes = exports.UnsetZoneName = exports.UnsetZone = exports.parseJSON = exports.isIgnorableWarning = exports.ExifToolTask = exports.ExifTime = exports.ExifDateTime = exports.ExifDate = exports.BinaryField = void 0;
29
+ exports.exiftool = exports.ExifTool = exports.UnsetZoneOffsetMinutes = exports.UnsetZoneName = exports.UnsetZone = exports.offsetMinutesToZoneName = exports.defaultVideosToUTC = exports.parseJSON = exports.isIgnorableWarning = exports.ExifToolTask = exports.ExifTime = exports.ExifDateTime = exports.ExifDate = exports.BinaryField = void 0;
30
30
  const bc = __importStar(require("batch-cluster"));
31
31
  const _cp = __importStar(require("child_process"));
32
32
  const _fs = __importStar(require("fs"));
33
- const _os = __importStar(require("os"));
34
- const _path = __importStar(require("path"));
35
33
  const process_1 = __importDefault(require("process"));
36
34
  const AsyncRetry_1 = require("./AsyncRetry");
37
35
  const BinaryExtractionTask_1 = require("./BinaryExtractionTask");
38
36
  const BinaryToBufferTask_1 = require("./BinaryToBufferTask");
37
+ const DefaultExifToolOptions_1 = require("./DefaultExifToolOptions");
39
38
  const DeleteAllTagsArgs_1 = require("./DeleteAllTagsArgs");
40
- const GeoTz_1 = require("./GeoTz");
41
- const IgnorableError_1 = require("./IgnorableError");
42
39
  const IsWin32_1 = require("./IsWin32");
43
40
  const Lazy_1 = require("./Lazy");
41
+ const Pick_1 = require("./Pick");
44
42
  const ReadRawTask_1 = require("./ReadRawTask");
45
43
  const ReadTask_1 = require("./ReadTask");
46
44
  const RewriteAllTagsTask_1 = require("./RewriteAllTagsTask");
@@ -57,77 +55,17 @@ var ExifTime_1 = require("./ExifTime");
57
55
  Object.defineProperty(exports, "ExifTime", { enumerable: true, get: function () { return ExifTime_1.ExifTime; } });
58
56
  var ExifToolTask_1 = require("./ExifToolTask");
59
57
  Object.defineProperty(exports, "ExifToolTask", { enumerable: true, get: function () { return ExifToolTask_1.ExifToolTask; } });
60
- var IgnorableError_2 = require("./IgnorableError");
61
- Object.defineProperty(exports, "isIgnorableWarning", { enumerable: true, get: function () { return IgnorableError_2.isIgnorableWarning; } });
58
+ var IgnorableError_1 = require("./IgnorableError");
59
+ Object.defineProperty(exports, "isIgnorableWarning", { enumerable: true, get: function () { return IgnorableError_1.isIgnorableWarning; } });
62
60
  var JSON_1 = require("./JSON");
63
61
  Object.defineProperty(exports, "parseJSON", { enumerable: true, get: function () { return JSON_1.parseJSON; } });
64
62
  var Timezones_1 = require("./Timezones");
63
+ Object.defineProperty(exports, "defaultVideosToUTC", { enumerable: true, get: function () { return Timezones_1.defaultVideosToUTC; } });
64
+ Object.defineProperty(exports, "offsetMinutesToZoneName", { enumerable: true, get: function () { return Timezones_1.offsetMinutesToZoneName; } });
65
65
  Object.defineProperty(exports, "UnsetZone", { enumerable: true, get: function () { return Timezones_1.UnsetZone; } });
66
66
  Object.defineProperty(exports, "UnsetZoneName", { enumerable: true, get: function () { return Timezones_1.UnsetZoneName; } });
67
67
  Object.defineProperty(exports, "UnsetZoneOffsetMinutes", { enumerable: true, get: function () { return Timezones_1.UnsetZoneOffsetMinutes; } });
68
- Object.defineProperty(exports, "defaultVideosToUTC", { enumerable: true, get: function () { return Timezones_1.defaultVideosToUTC; } });
69
- Object.defineProperty(exports, "offsetMinutesToZoneName", { enumerable: true, get: function () { return Timezones_1.offsetMinutesToZoneName; } });
70
- function findExiftool() {
71
- const path = require(`exiftool-vendored.${(0, IsWin32_1.isWin32)() ? "exe" : "pl"}`);
72
- // This s/app.asar/app.asar.unpacked/ path switch adds support for Electron
73
- // apps that are ASAR-packed.
74
- // Note that we can't check for electron because child processes that are
75
- // spawned by the main process will most likely need the ELECTRON_RUN_AS_NODE
76
- // environment variable set, which will unset the process.versions.electron
77
- // field.
78
- const fixedPath = path
79
- .split(_path.sep)
80
- .map((ea) => (ea === "app.asar" ? "app.asar.unpacked" : ea))
81
- .join(_path.sep);
82
- // Note also, that we must check for the fixedPath first, because Electron's
83
- // ASAR shenanigans will make existsSync return true even for asar-packed
84
- // resources.
85
- if (_fs.existsSync(fixedPath)) {
86
- return fixedPath;
87
- }
88
- if (_fs.existsSync(path)) {
89
- return path;
90
- }
91
- throw new Error(`Vendored ExifTool does not exist at ${path}`);
92
- }
93
- exports.DefaultExifToolPath = findExiftool();
94
- exports.DefaultExiftoolArgs = ["-stay_open", "True", "-@", "-"];
95
68
  const _ignoreShebang = (0, Lazy_1.lazy)(() => !(0, IsWin32_1.isWin32)() && !_fs.existsSync("/usr/bin/perl"));
96
- exports.DefaultMaxProcs = Math.max(1, Math.floor(_os.cpus().length / 4));
97
- /**
98
- * Default values for `ExifToolOptions`, except for `processFactory` (which is
99
- * created by the ExifTool constructor)
100
- */
101
- exports.DefaultExifToolOptions = Object.freeze({
102
- ...new bc.BatchClusterOptions(),
103
- maxProcs: exports.DefaultMaxProcs,
104
- maxTasksPerProcess: 500,
105
- spawnTimeoutMillis: 30000,
106
- // see https://github.com/photostructure/exiftool-vendored.js/issues/34 :
107
- taskTimeoutMillis: 20000,
108
- onIdleIntervalMillis: 2000,
109
- taskRetries: 1,
110
- exiftoolPath: exports.DefaultExifToolPath,
111
- exiftoolArgs: exports.DefaultExiftoolArgs,
112
- exiftoolEnv: {},
113
- pass: "{ready}",
114
- fail: "{ready}",
115
- exitCommand: "-stay_open\nFalse\n",
116
- versionCommand: new VersionTask_1.VersionTask().command,
117
- healthCheckIntervalMillis: 30000,
118
- healthCheckCommand: "-ver\n-execute\n",
119
- numericTags: [
120
- "*Duration*",
121
- "GPSAltitude",
122
- "GPSLatitude",
123
- "GPSLongitude",
124
- "GPSPosition",
125
- "Orientation",
126
- ],
127
- defaultVideosToUTC: true,
128
- geoTz: GeoTz_1.geoTz,
129
- isIgnorableError: IgnorableError_1.isIgnorableWarning,
130
- });
131
69
  /**
132
70
  * Manages delegating calls to a vendored running instance of ExifTool.
133
71
  *
@@ -146,7 +84,7 @@ class ExifTool {
146
84
  throw new Error("Please update caller to the new ExifTool constructor API");
147
85
  }
148
86
  const o = {
149
- ...exports.DefaultExifToolOptions,
87
+ ...DefaultExifToolOptions_1.DefaultExifToolOptions,
150
88
  ...options,
151
89
  };
152
90
  const ignoreShebang = (_a = o.ignoreShebang) !== null && _a !== void 0 ? _a : _ignoreShebang();
@@ -184,44 +122,49 @@ class ExifTool {
184
122
  * Read the tags in `file`.
185
123
  *
186
124
  * @param {string} file the file to extract metadata tags from
187
- * @param {string[]} [optionalArgs] any additional ExifTool arguments, like "-fast" or
188
- * "-fast2". **Most other arguments will require you to use `readRaw`.**
189
- * Note that the default is "-fast", so if you want ExifTool to read the
190
- * entire file for metadata, you should pass an empty array as the second
191
- * parameter. See https://exiftool.org/#performance for
192
- * more information about `-fast` and `-fast2`.
125
+ *
126
+ * @param {string[]} [optionalArgs] any additional ExifTool arguments, like
127
+ * "-fast" or "-fast2". **Most other arguments will require you to use
128
+ * `readRaw`.** Note that the default is "-fast", so if you want ExifTool to
129
+ * read the entire file for metadata, you should pass an empty array as the
130
+ * second parameter. See https://exiftool.org/#performance for more
131
+ * information about `-fast` and `-fast2`.
132
+ *
193
133
  * @returns {Promise<Tags>} A resolved Tags promise. If there are errors
194
134
  * during reading, the `.errors` field will be present.
195
- * @memberof ExifTool
196
135
  */
197
- read(file, optionalArgs = ["-fast"]) {
136
+ read(file, optionalArgs = ["-fast"], options) {
198
137
  return this.enqueueTask(() => ReadTask_1.ReadTask.for(file, {
199
138
  optionalArgs,
200
- numericTags: this.options.numericTags,
201
- defaultVideosToUTC: this.options.defaultVideosToUTC,
202
- geoTz: this.options.geoTz,
139
+ ...(0, Pick_1.pick)(this.options, "numericTags", "useMWG", "includeImageDataMD5", "defaultVideosToUTC", "geoTz"),
140
+ ...options,
203
141
  })); // < no way to know at compile time if we're going to get back a T!
204
142
  }
205
143
  /**
206
- * Read the tags from `file`, without any post-processing of ExifTool values.
144
+ * Read the tags from `file`, without any post-processing of ExifTool
145
+ * values.
207
146
  *
208
- * **You probably want `read`, not this method. READ THE REST OF THIS COMMENT
209
- * CAREFULLY.**
147
+ * **You probably want `read`, not this method. READ THE REST OF THIS
148
+ * COMMENT CAREFULLY.**
210
149
  *
211
- * If you want to extract specific tag values from a file, you may want to use
212
- * this, but all data validation and inference heuristics provided by `read`
213
- * will be skipped.
150
+ * If you want to extract specific tag values from a file, you may want to
151
+ * use this, but all data validation and inference heuristics provided by
152
+ * `read` will be skipped.
214
153
  *
215
- * Note that performance will be very similar to `read`, and will actually be
216
- * worse if you don't include `-fast` or `-fast2` (as the most expensive bit
217
- * is the perl interpreter and scanning the file on disk).
154
+ * Note that performance will be very similar to `read`, and will actually
155
+ * be worse if you don't include `-fast` or `-fast2` (as the most expensive
156
+ * bit is the perl interpreter and scanning the file on disk).
218
157
  *
219
- * @param args any additional arguments other than the file path. Note that "-json", and the Windows unicode filename handler flags, "-charset filename=utf8", will be added automatically.
158
+ * @param args any additional arguments other than the file path. Note that
159
+ * "-json", and the Windows unicode filename handler flags, "-charset
160
+ * filename=utf8", will be added automatically.
220
161
  *
221
162
  * @return Note that the return value will be similar to `Tags`, but with no
222
- * date, time, or other rich type parsing that you get from `.read()`. The field values will be `string | number | string[]`.
163
+ * date, time, or other rich type parsing that you get from `.read()`. The
164
+ * field values will be `string | number | string[]`.
223
165
  *
224
- * @see https://github.com/photostructure/exiftool-vendored.js/issues/44
166
+ * @see https://github.com/photostructure/exiftool-vendored.js/issues/44 for
167
+ * typing details.
225
168
  */
226
169
  readRaw(file, args = []) {
227
170
  return this.enqueueTask(() => ReadRawTask_1.ReadRawTask.for(file, args));
@@ -238,9 +181,12 @@ class ExifTool {
238
181
  * there are errors or warnings.
239
182
  * @memberof ExifTool
240
183
  */
241
- write(file, tags, args) {
184
+ write(file, tags, args, options) {
242
185
  const retriable = false;
243
- return this.enqueueTask(() => WriteTask_1.WriteTask.for(file, tags, args), retriable);
186
+ return this.enqueueTask(() => WriteTask_1.WriteTask.for(file, tags, args, {
187
+ ...(0, Pick_1.pick)(this.options, "useMWG"),
188
+ ...options,
189
+ }), retriable);
244
190
  }
245
191
  /**
246
192
  * This will strip `file` of all metadata tags. The original file (with the
@@ -1 +1 @@
1
- {"version":3,"file":"ExifTool.js","sourceRoot":"","sources":["../src/ExifTool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,mDAAoC;AACpC,wCAAyB;AACzB,wCAAyB;AACzB,4CAA6B;AAC7B,sDAA6B;AAE7B,6CAA4C;AAC5C,iEAA6D;AAC7D,6DAAyD;AACzD,2DAAuD;AAKvD,mCAA+B;AAE/B,qDAAqE;AACrE,uCAAmC;AACnC,iCAA6B;AAK7B,+CAA2C;AAC3C,yCAAqC;AAErC,6DAAyD;AACzD,qCAA0C;AA6B1C,+CAA2C;AAC3C,2CAAuC;AAEvC,6CAA2C;AAAlC,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AAO,SAAS,CAAC,CAAC,CAAC,IAAA,0BAAa,EAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACrE,CAAC;IAED;;;;;OAKG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IACjC,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAA;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAA;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAA;IACxC,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAA;IACzC,CAAC;IAED;;;OAGG;IACH,mBAAmB,CAAC,UAAU,GAAG,IAAI;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAA;IAC1D,CAAC;CACF;AAzWD,4BAyWC;AAED;;;;;;;;;;GAUG;AACU,QAAA,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA"}
@@ -61,14 +61,40 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
61
61
  */
62
62
  exiftoolEnv: NodeJS.ProcessEnv;
63
63
  /**
64
- * Tag names (which can have '*' glob matchers) which you want numeric values,
65
- * rather than ExifTool's "Print Conversion."
64
+ * Should ExifTool use MWG (Metadata Working Group) composite tags for
65
+ * reading and writing tags?
66
66
  *
67
- * If the tag value is only for human consumption, you may want to leave this
68
- * blank. The default is `["*Duration*"]`, but you may want to include
69
- * "Orientation" as well.
67
+ * ExifTool recommends this to be set to true.
68
+ *
69
+ * Note that this can result in many tag value differences from
70
+ * `ExifTool.read`, and makes `ExifTool.write` write to "synonymous" MWG
71
+ * tags automatically.
72
+ *
73
+ * @see https://exiftool.org/TagNames/MWG.html for details
74
+ */
75
+ useMWG: boolean;
76
+ /**
77
+ * Tag names (which can have '*' glob matchers) which you want numeric
78
+ * values, rather than ExifTool's "Print Conversion."
79
+ *
80
+ * If you're using tag values only for human consumption, you may want to
81
+ * leave this blank.
82
+ *
83
+ * The default includes "*Duration*", "GPSAltitude", "GPSLatitude",
84
+ * "GPSLongitude", "GPSPosition", and "Orientation".
70
85
  */
71
86
  numericTags: string[];
87
+ /**
88
+ * If set to true, ExifTool will attempt to calculate an "ImageDataMD5" tag
89
+ * value with the MD5 checksum of image data.
90
+ *
91
+ * Note that as of 2022-04-12, ExifTool supports JPEG, PNG, and many raw
92
+ * image formats, like CR2 and NEF. It doesn't yet support HEIC/HEIF, ORF,
93
+ * GIF, and many video formats, like MP4 and MTS.
94
+ *
95
+ * This defaults to false, as it adds ~20ms of overhead to every read
96
+ */
97
+ includeImageDataMD5: boolean;
72
98
  /**
73
99
  * Video file dates are assumed to be in UTC, rather than using timezone
74
100
  * inference used in images. To disable this default, set this to false.
@@ -0,0 +1 @@
1
+ export declare const DefaultExifToolPath: string;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DefaultExifToolPath = void 0;
27
+ const _fs = __importStar(require("fs"));
28
+ const _path = __importStar(require("path"));
29
+ const IsWin32_1 = require("./IsWin32");
30
+ function findExiftool() {
31
+ const path = require(`exiftool-vendored.${(0, IsWin32_1.isWin32)() ? "exe" : "pl"}`);
32
+ // This s/app.asar/app.asar.unpacked/ path switch adds support for Electron
33
+ // apps that are ASAR-packed.
34
+ // Note that we can't check for electron because child processes that are
35
+ // spawned by the main process will most likely need the ELECTRON_RUN_AS_NODE
36
+ // environment variable set, which will unset the process.versions.electron
37
+ // field.
38
+ const fixedPath = path
39
+ .split(_path.sep)
40
+ .map((ea) => (ea === "app.asar" ? "app.asar.unpacked" : ea))
41
+ .join(_path.sep);
42
+ // Note also, that we must check for the fixedPath first, because Electron's
43
+ // ASAR shenanigans will make existsSync return true even for asar-packed
44
+ // resources.
45
+ if (_fs.existsSync(fixedPath)) {
46
+ return fixedPath;
47
+ }
48
+ if (_fs.existsSync(path)) {
49
+ return path;
50
+ }
51
+ throw new Error(`Vendored ExifTool does not exist at ${path}`);
52
+ }
53
+ exports.DefaultExifToolPath = findExiftool();
54
+ //# sourceMappingURL=FindExiftool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FindExiftool.js","sourceRoot":"","sources":["../src/FindExiftool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyB;AACzB,4CAA6B;AAC7B,uCAAmC;AAEnC,SAAS,YAAY;IACnB,MAAM,IAAI,GAAW,OAAO,CAAC,qBAAqB,IAAA,iBAAO,GAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IAC7E,2EAA2E;IAC3E,6BAA6B;IAC7B,yEAAyE;IACzE,6EAA6E;IAC7E,2EAA2E;IAC3E,SAAS;IACT,MAAM,SAAS,GAAG,IAAI;SACnB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;SAChB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC3D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAElB,4EAA4E;IAC5E,yEAAyE;IACzE,aAAa;IACb,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAA;KACjB;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACxB,OAAO,IAAI,CAAA;KACZ;IACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC;AAEY,QAAA,mBAAmB,GAAG,YAAY,EAAE,CAAA"}