exiftool-vendored 25.1.0 → 26.0.0

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +26 -1
  3. package/dist/BinaryExtractionTask.d.ts +2 -2
  4. package/dist/BinaryExtractionTask.js +4 -4
  5. package/dist/BinaryExtractionTask.js.map +1 -1
  6. package/dist/BinaryToBufferTask.d.ts +2 -2
  7. package/dist/BinaryToBufferTask.js +6 -11
  8. package/dist/BinaryToBufferTask.js.map +1 -1
  9. package/dist/DefaultExifToolOptions.d.ts +2 -0
  10. package/dist/DefaultExifToolOptions.js +16 -1
  11. package/dist/DefaultExifToolOptions.js.map +1 -1
  12. package/dist/ExifTool.d.ts +27 -14
  13. package/dist/ExifTool.js +62 -22
  14. package/dist/ExifTool.js.map +1 -1
  15. package/dist/ExifToolOptions.d.ts +9 -1
  16. package/dist/ExifToolOptions.js.map +1 -1
  17. package/dist/ExifToolTask.d.ts +5 -2
  18. package/dist/ExifToolTask.js +10 -4
  19. package/dist/ExifToolTask.js.map +1 -1
  20. package/dist/ExiftoolPath.d.ts +26 -0
  21. package/dist/ExiftoolPath.js +34 -17
  22. package/dist/ExiftoolPath.js.map +1 -1
  23. package/dist/ReadRawTask.d.ts +2 -2
  24. package/dist/ReadRawTask.js +4 -4
  25. package/dist/ReadRawTask.js.map +1 -1
  26. package/dist/ReadTask.d.ts +5 -4
  27. package/dist/ReadTask.js +3 -2
  28. package/dist/ReadTask.js.map +1 -1
  29. package/dist/RewriteAllTagsTask.d.ts +4 -2
  30. package/dist/RewriteAllTagsTask.js +5 -5
  31. package/dist/RewriteAllTagsTask.js.map +1 -1
  32. package/dist/Tags.d.ts +22 -20
  33. package/dist/VersionTask.d.ts +2 -2
  34. package/dist/VersionTask.js +2 -2
  35. package/dist/VersionTask.js.map +1 -1
  36. package/dist/WriteTask.d.ts +5 -3
  37. package/dist/WriteTask.js +5 -4
  38. package/dist/WriteTask.js.map +1 -1
  39. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -26,6 +26,23 @@ vendored versions of ExifTool match the version that they vendor.
26
26
 
27
27
  ## Version history
28
28
 
29
+ ### v26.0.0
30
+
31
+ - 🌱/✨ ExifTool upgraded to [v12.84](https://exiftool.org/history.html#12.84)
32
+
33
+ - 📦 Support **disabling** `-ignoreMinorErrors` to work around shenanigans like [#181](https://github.com/photostructure/exiftool-vendored.js/issues/181). This is an optional field that defaults to prior behavior (enabled, which ignores minor errors).
34
+
35
+ - 📦 ExifTool on Windows was upgraded to Strawberry Perl 5.32.1
36
+
37
+ ### v25.2.0
38
+
39
+ - 🌱/✨ ExifTool upgraded to [v12.82](https://exiftool.org/history.html#v12.82)
40
+
41
+ - 📦 Add support for `NODE_DEBUG=exiftool-vendored`
42
+
43
+ - 📦 Export `exiftoolPath()` so custom implementations can use it as a fallback
44
+ (or default, and provide their own fallback)
45
+
29
46
  ### v25.1.0
30
47
 
31
48
  - ✨ Added `retain` field to [`ExifTool.deleteAllTags`](https://photostructure.github.io/exiftool-vendored.js/classes/ExifTool.html#deleteAllTags) to address [#178](https://github.com/photostructure/exiftool-vendored.js/issues/178)
package/README.md CHANGED
@@ -43,6 +43,20 @@
43
43
  or
44
44
 
45
45
  npm install --save exiftool-vendored
46
+
47
+ ### Debug logging
48
+
49
+ If anything doesn't work, the first thing to try is enabling the logger.
50
+
51
+ You can provide a [Logger implementation](https://photostructure.github.io/batch-cluster.js/interfaces/Logger.html) via [`ExifToolOptions.logger`](https://photostructure.github.io/exiftool-vendored.js/interfaces/ExifToolOptions.html#logger), or set the environment variable `NODE_DEBUG=exiftool-vendored`. [See the debuglog() documentation](https://nodejs.org/docs/latest/api/util.html#utildebuglogsection-callback) for more details.
52
+
53
+ ### Regarding use within Electron
54
+
55
+ Due to how different every Electron application setup is, and how new versions
56
+ frequently have breaking changes, **do not ask for help by opening a github
57
+ issue on this project.**
58
+
59
+ Please seek help via StackOverflow, the Electron discord, or other channels.
46
60
 
47
61
  ### Electron-builder support
48
62
 
@@ -52,17 +66,28 @@ Add the following pattern to `electron-builder.yml`'s `asarUnpack`:
52
66
  - "node_modules/exiftool-vendored.*/**/*"
53
67
  ```
54
68
 
69
+ The default `exiftoolPath` implementation will detect `app.asar` in your `require`
70
+ path and replace it with `app.asar.unpacked` automatically.
71
+
55
72
  ### Electron-forge support
56
73
 
57
74
  Version 25.0 of this library added experimental support for `electron-forge`:
58
75
  add the following element to your `ForgeConfig.packagerConfig.extraResource`
59
- string array, and things should "just work":
76
+ string array, and things should "just work" **for the main process**.
60
77
 
61
78
  ```ts
62
79
  "./node_modules/exiftool-vendored." +
63
80
  (process.platform === "win32" ? "exe" : "pl")
64
81
  ```
65
82
 
83
+ **If your main process forks any node subprocesses, `process.resourcesPath` _will
84
+ not be set_ in those subprocesses, and the default `exiftoolPath` won't work.**
85
+
86
+ If this is your case, you must provide a correct implementation of
87
+ [ExifToolOptions.exiftoolPath](https://photostructure.github.io/exiftool-vendored.js/interfaces/ExifToolOptions.html#exiftoolPath),
88
+ either by passing through `resourcesPath` via `process.env`, or some other
89
+ method.
90
+
66
91
  ### Installation notes
67
92
 
68
93
  - `exiftool-vendored` provides an installation of ExifTool relevant for your
@@ -1,4 +1,4 @@
1
- import { ExifToolTask } from "./ExifToolTask";
1
+ import { ExifToolTask, ExifToolTaskOptions } from "./ExifToolTask";
2
2
  import { Maybe } from "./Maybe";
3
3
  /**
4
4
  * Task that returns an error string (to prevent retries), or undefined if
@@ -6,6 +6,6 @@ import { Maybe } from "./Maybe";
6
6
  */
7
7
  export declare class BinaryExtractionTask extends ExifToolTask<Maybe<string>> {
8
8
  private constructor();
9
- static for(tagname: string, imgSrc: string, imgDest: string): BinaryExtractionTask;
9
+ static for(tagname: string, imgSrc: string, imgDest: string, options?: ExifToolTaskOptions): BinaryExtractionTask;
10
10
  parse(stdout: string, err?: Error): Maybe<string>;
11
11
  }
@@ -14,10 +14,10 @@ const StdoutRe = /\b(\d+) output files? created/i;
14
14
  * everything seems to have worked.
15
15
  */
16
16
  class BinaryExtractionTask extends ExifToolTask_1.ExifToolTask {
17
- constructor(args) {
18
- super(args);
17
+ constructor(args, options) {
18
+ super(args, options);
19
19
  }
20
- static for(tagname, imgSrc, imgDest) {
20
+ static for(tagname, imgSrc, imgDest, options) {
21
21
  const args = [
22
22
  ...FilenameCharsetArgs_1.Utf8FilenameCharsetArgs,
23
23
  "-b",
@@ -28,7 +28,7 @@ class BinaryExtractionTask extends ExifToolTask_1.ExifToolTask {
28
28
  "%0f" + node_path_1.default.resolve(imgDest),
29
29
  node_path_1.default.resolve(imgSrc),
30
30
  ];
31
- return new BinaryExtractionTask(args);
31
+ return new BinaryExtractionTask(args, options);
32
32
  }
33
33
  parse(stdout, err) {
34
34
  const s = (0, String_1.toS)(stdout).trim();
@@ -1 +1 @@
1
- {"version":3,"file":"BinaryExtractionTask.js","sourceRoot":"","sources":["../src/BinaryExtractionTask.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAC5B,iDAA6C;AAC7C,+DAA+D;AAE/D,qCAA8B;AAE9B,MAAM,QAAQ,GAAG,gCAAgC,CAAA;AAEjD;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,2BAA2B;IACnE,YAAoB,IAAc;QAChC,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC;IAED,MAAM,CAAC,GAAG,CACR,OAAe,EACf,MAAc,EACd,OAAe;QAEf,MAAM,IAAI,GAAG;YACX,GAAG,6CAAuB;YAC1B,IAAI;YACJ,GAAG,GAAG,OAAO;YACb,IAAI;YACJ,uCAAuC;YACvC,+DAA+D;YAC/D,KAAK,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAC7B,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC;SACrB,CAAA;QACD,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,MAAc,EAAE,GAAW;QA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,CAAC;IAED,KAAK,CAAC,MAAc,EAAE,GAAW;QAC/B,MAAM,CAAC,GAAG,IAAA,YAAG,EAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;QAC5B,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC1B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,GAAG,CAAA;QACX,CAAC;aAAM,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAA;QACzE,CAAC;aAAM,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACxB,OAAM;QACR,CAAC;aAAM,CAAC;YACN,2EAA2E;YAC3E,OAAO,CAAC,CAAA;QACV,CAAC;IACH,CAAC;CACF;AAtCD,oDAsCC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { ExifToolTask } from "./ExifToolTask";
2
+ import { ExifToolTask, ExifToolTaskOptions } from "./ExifToolTask";
3
3
  /**
4
4
  * Task that returns an error string (to prevent retries), or undefined if
5
5
  * everything seems to have worked.
@@ -7,6 +7,6 @@ import { ExifToolTask } from "./ExifToolTask";
7
7
  export declare class BinaryToBufferTask extends ExifToolTask<Buffer | Error> {
8
8
  readonly tagname: string;
9
9
  private constructor();
10
- static for(tagname: string, imgSrc: string): BinaryToBufferTask;
10
+ static for(tagname: string, imgSrc: string, options?: ExifToolTaskOptions): BinaryToBufferTask;
11
11
  parse(data: string, err?: Error): Buffer | Error;
12
12
  }
@@ -13,21 +13,16 @@ const String_1 = require("./String");
13
13
  * everything seems to have worked.
14
14
  */
15
15
  class BinaryToBufferTask extends ExifToolTask_1.ExifToolTask {
16
- constructor(tagname, args) {
17
- super(args);
16
+ constructor(tagname, args, options) {
17
+ super(args, options);
18
18
  this.tagname = tagname;
19
19
  }
20
- static for(tagname, imgSrc) {
20
+ static for(tagname, imgSrc, options) {
21
21
  // NOTE TO FUTURE ME: we don't need to escape these arguments, because
22
22
  // ExifTool separates them via newlines.
23
- const args = [
24
- ...FilenameCharsetArgs_1.Utf8FilenameCharsetArgs,
25
- "-json",
26
- "-b",
27
- "-" + tagname,
28
- node_path_1.default.resolve(imgSrc),
29
- ];
30
- return new BinaryToBufferTask(tagname, args);
23
+ const args = [...FilenameCharsetArgs_1.Utf8FilenameCharsetArgs, "-json", "-b", "-" + tagname];
24
+ args.push(node_path_1.default.resolve(imgSrc));
25
+ return new BinaryToBufferTask(tagname, args, options);
31
26
  }
32
27
  parse(data, err) {
33
28
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"BinaryToBufferTask.js","sourceRoot":"","sources":["../src/BinaryToBufferTask.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAC5B,iDAA6C;AAC7C,+DAA+D;AAE/D,qCAAmC;AAEnC;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,2BAA4B;IAClE,YACW,OAAe,EACxB,IAAc;QAEd,KAAK,CAAC,IAAI,CAAC,CAAA;QAHF,YAAO,GAAP,OAAO,CAAQ;IAI1B,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,OAAe,EAAE,MAAc;QACxC,sEAAsE;QACtE,wCAAwC;QACxC,MAAM,IAAI,GAAG;YACX,GAAG,6CAAuB;YAC1B,OAAO;YACP,IAAI;YACJ,GAAG,GAAG,OAAO;YACb,mBAAI,CAAC,OAAO,CAAC,MAAM,CAAC;SACrB,CAAA;QACD,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,GAAW;;QAC7B,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,0CAAG,CAAC,CAAC,CAAA;YACjC,iCAAiC;YACjC,CAAC;gBACC,MAAM,MAAM,GAAG,MAAM,CAAC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,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC7B,IAAI,MAAM,IAAI,IAAI;wBAAE,OAAO,MAAM,CAAA;gBACnC,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,IAAA,iBAAQ,EAAC,IAAI,CAAC;gBACpB,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;gBACjB,CAAC,CAAC,MAAM,YAAY,KAAK;oBACvB,CAAC,CAAC,MAAM;oBACR,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAA;QACjC,CAAC;QACD,OAAO,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;IACtD,CAAC;CACF;AA5CD,gDA4CC;AAED,MAAM,SAAS,GAAG,SAAS,CAAA;AAE3B,SAAS,MAAM,CAAC,IAAmB;IACjC,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAChD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC7D,CAAC"}
@@ -1,5 +1,7 @@
1
+ import * as bc from "batch-cluster";
1
2
  import { ExifToolOptions } from "./ExifToolOptions";
2
3
  import { Omit } from "./Omit";
4
+ export declare const ConsoleLogger: bc.Logger;
3
5
  /**
4
6
  * Default values for `ExifToolOptions`, except for `processFactory` (which is
5
7
  * created by the ExifTool constructor)
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DefaultExifToolOptions = void 0;
26
+ exports.DefaultExifToolOptions = exports.ConsoleLogger = void 0;
27
27
  const bc = __importStar(require("batch-cluster"));
28
+ const node_util_1 = require("node:util");
28
29
  const CapturedAtTagNames_1 = require("./CapturedAtTagNames");
29
30
  const DefaultExiftoolArgs_1 = require("./DefaultExiftoolArgs");
30
31
  const DefaultMaxProcs_1 = require("./DefaultMaxProcs");
@@ -32,6 +33,18 @@ const ExiftoolPath_1 = require("./ExiftoolPath");
32
33
  const GeoTz_1 = require("./GeoTz");
33
34
  const IsWin32_1 = require("./IsWin32");
34
35
  const VersionTask_1 = require("./VersionTask");
36
+ const _debuglog = (0, node_util_1.debuglog)("exiftool-vendored");
37
+ function noop() { }
38
+ exports.ConsoleLogger = {
39
+ trace: noop,
40
+ debug: _debuglog,
41
+ info: _debuglog,
42
+ warn: console.warn,
43
+ error: console.error,
44
+ };
45
+ function logger() {
46
+ return (0, node_util_1.debuglog)("exiftool-vendored").enabled ? exports.ConsoleLogger : bc.NoLogger;
47
+ }
35
48
  /**
36
49
  * Default values for `ExifToolOptions`, except for `processFactory` (which is
37
50
  * created by the ExifTool constructor)
@@ -60,10 +73,12 @@ exports.DefaultExifToolOptions = Object.freeze({
60
73
  geoTz: GeoTz_1.geoTz,
61
74
  geolocation: false,
62
75
  ignoreZeroZeroLatLon: true,
76
+ ignoreMinorErrors: true,
63
77
  imageHashType: false,
64
78
  includeImageDataMD5: undefined,
65
79
  inferTimezoneFromDatestamps: false, // to retain prior behavior
66
80
  inferTimezoneFromDatestampTags: [...CapturedAtTagNames_1.CapturedAtTagNames],
81
+ logger,
67
82
  numericTags: [
68
83
  "*Duration*",
69
84
  "GPSAltitude",
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultExifToolOptions.js","sourceRoot":"","sources":["../src/DefaultExifToolOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,6DAAyD;AACzD,+DAA2D;AAC3D,uDAAmD;AAEnD,iDAA6C;AAC7C,mCAA+B;AAC/B,uCAAmC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IAC9B,2BAA2B,EAAE,KAAK,EAAE,2BAA2B;IAC/D,8BAA8B,EAAE,CAAC,GAAG,uCAAkB,CAAC;IACvD,MAAM;IACN,WAAW,EAAE;QACX,YAAY;QACZ,aAAa;QACb,aAAa;QACb,cAAc;QACd,aAAa;QACb,aAAa;KACd;IACD,MAAM,EAAE,KAAK;CACd,CAAC,CAAA"}
@@ -4,7 +4,7 @@ import { ApplicationRecordTags } from "./ApplicationRecordTags";
4
4
  import { Defined, DefinedOrNullValued } from "./Defined";
5
5
  import { ErrorsAndWarnings } from "./ErrorsAndWarnings";
6
6
  import { ExifToolOptions } from "./ExifToolOptions";
7
- import { ExifToolTask } from "./ExifToolTask";
7
+ import { ExifToolTask, ExifToolTaskOptions } from "./ExifToolTask";
8
8
  import { ExifToolVendoredTags } from "./ExifToolVendoredTags";
9
9
  import { ICCProfileTags } from "./ICCProfileTags";
10
10
  import { CollectionInfo, KeywordInfoStruct, KeywordStruct, MWGCollectionsTags, MWGKeywordTags } from "./MWGTags";
@@ -29,24 +29,35 @@ export { ExifDate } from "./ExifDate";
29
29
  export { ExifDateTime } from "./ExifDateTime";
30
30
  export { ExifTime } from "./ExifTime";
31
31
  export { ExifToolTask } from "./ExifToolTask";
32
+ export { exiftoolPath } from "./ExiftoolPath";
32
33
  export { isGeolocationTag } from "./GeolocationTags";
33
34
  export { parseJSON } from "./JSON";
34
35
  export { DefaultReadTaskOptions } from "./ReadTask";
35
36
  export { UnsetZone, UnsetZoneName, UnsetZoneOffsetMinutes, defaultVideosToUTC, offsetMinutesToZoneName, } from "./Timezones";
36
37
  export { DefaultWriteTaskOptions } from "./WriteTask";
37
- export type { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, AdditionalWriteTags, ApplicationRecordTags, CollectionInfo, CompositeTags, Defined, DefinedOrNullValued, EXIFTags, ErrorsAndWarnings, ExifToolOptions, ExifToolTags, ExifToolVendoredTags, ExpandedDateTags, FileTags, FlashPixTags, GeolocationTags, ICCProfileTags, IPTCTags, JFIFTags, Json, KeywordInfoStruct, KeywordStruct, Literal, MPFTags, MWGCollectionsTags, MWGKeywordTags, MakerNotesTags, Maybe, MetaTags, MutableTags, Omit, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RIFFTags, RawTags, ReadTaskOptions, ResourceEvent, ShortcutTags, Struct, StructAppendTags, Tags, Version, WriteTags, WriteTaskOptions, WriteTaskResult, XMPTags, };
38
+ export type { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, AdditionalWriteTags, ApplicationRecordTags, CollectionInfo, CompositeTags, Defined, DefinedOrNullValued, EXIFTags, ErrorsAndWarnings, ExifToolOptions, ExifToolTags, ExifToolTaskOptions, ExifToolVendoredTags, ExpandedDateTags, FileTags, FlashPixTags, GeolocationTags, ICCProfileTags, IPTCTags, JFIFTags, Json, KeywordInfoStruct, KeywordStruct, Literal, MPFTags, MWGCollectionsTags, MWGKeywordTags, MakerNotesTags, Maybe, MetaTags, MutableTags, Omit, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RIFFTags, RawTags, ReadTaskOptions, ResourceEvent, ShortcutTags, Struct, StructAppendTags, Tags, Version, WriteTags, WriteTaskOptions, WriteTaskResult, XMPTags, };
38
39
  /**
39
40
  * Manages delegating calls to a cluster of ExifTool child processes.
40
41
  *
41
- * Instances should be shared: consider using the exported singleton instance
42
- * of this class, {@link exiftool}.
42
+ * **NOTE: Instances are expensive!**
43
+ *
44
+ * * use either the default exported singleton instance of this class,
45
+ * {@link exiftool}, or your own singleton
46
+ *
47
+ * * make sure you await {@link ExifTool.end} when you're done with an instance
48
+ * to clean up subprocesses
49
+ *
50
+ * * review the {@link ExifToolOptions} for configuration options--the default
51
+ * values are conservative to avoid overwhelming your system.
52
+ *
53
+ * @see https://photostructure.github.io/exiftool-vendored.js/ for more documentation.
43
54
  */
44
55
  export declare class ExifTool {
45
56
  #private;
46
57
  readonly options: ExifToolOptions;
47
- private readonly batchCluster;
48
- readonly exiftoolPath: () => Promise<string>;
58
+ readonly batchCluster: bc.BatchCluster;
49
59
  constructor(options?: Partial<ExifToolOptions>);
60
+ readonly exiftoolPath: () => Promise<string>;
50
61
  /**
51
62
  * Register life cycle event listeners. Delegates to BatchProcess.
52
63
  */
@@ -74,7 +85,7 @@ export declare class ExifTool {
74
85
  * @returns {Promise<Tags>} A resolved Tags promise. If there are errors
75
86
  * during reading, the `.errors` field will be present.
76
87
  */
77
- read<T extends Tags = Tags>(file: string, optionalArgs?: string[], options?: Partial<ReadTaskOptions>): Promise<T>;
88
+ read<T extends Tags = Tags>(file: string, optionalArgs?: string[], options?: ReadTaskOptions): Promise<T>;
78
89
  /**
79
90
  * Read the tags from `file`, without any post-processing of ExifTool
80
91
  * values.
@@ -129,7 +140,7 @@ export declare class ExifTool {
129
140
  */
130
141
  deleteAllTags(file: string, opts?: {
131
142
  retain?: (keyof Tags | string)[];
132
- }): Promise<WriteTaskResult>;
143
+ } & Partial<ExifToolTaskOptions>): Promise<WriteTaskResult>;
133
144
  /**
134
145
  * Extract the low-resolution thumbnail in `path/to/image.jpg`
135
146
  * and write it to `path/to/thumbnail.jpg`.
@@ -139,7 +150,7 @@ export declare class ExifTool {
139
150
  * @return a `Promise<void>`. An `Error` is raised if
140
151
  * the file could not be read or the output not written.
141
152
  */
142
- extractThumbnail(imageFile: string, thumbnailFile: string): Promise<void>;
153
+ extractThumbnail(imageFile: string, thumbnailFile: string, opts?: ExifToolOptions): Promise<void>;
143
154
  /**
144
155
  * Extract the "preview" image in `path/to/image.jpg`
145
156
  * and write it to `path/to/preview.jpg`.
@@ -150,7 +161,7 @@ export declare class ExifTool {
150
161
  * @return a `Promise<void>`. An `Error` is raised if
151
162
  * the file could not be read or the output not written.
152
163
  */
153
- extractPreview(imageFile: string, previewFile: string): Promise<void>;
164
+ extractPreview(imageFile: string, previewFile: string, opts?: ExifToolOptions): Promise<void>;
154
165
  /**
155
166
  * Extract the "JpgFromRaw" image in `path/to/image.jpg` and write it to
156
167
  * `path/to/fromRaw.jpg`.
@@ -161,7 +172,7 @@ export declare class ExifTool {
161
172
  * @return a `Promise<void>`. The promise will be rejected if the file could
162
173
  * not be read or the output not written.
163
174
  */
164
- extractJpgFromRaw(imageFile: string, outputFile: string): Promise<void>;
175
+ extractJpgFromRaw(imageFile: string, outputFile: string, opts?: ExifToolOptions): Promise<void>;
165
176
  /**
166
177
  * Extract a given binary value from "tagname" tag associated to
167
178
  * `path/to/image.jpg` and write it to `dest` (which cannot exist and whose
@@ -170,7 +181,7 @@ export declare class ExifTool {
170
181
  * @return a `Promise<void>`. The promise will be rejected if the binary
171
182
  * output not be written to `dest`.
172
183
  */
173
- extractBinaryTag(tagname: string, src: string, dest: string): Promise<void>;
184
+ extractBinaryTag(tagname: string, src: string, dest: string, opts?: ExifToolTaskOptions): Promise<void>;
174
185
  /**
175
186
  * Extract a given binary value from "tagname" tag associated to
176
187
  * `path/to/image.jpg` as a `Buffer`. This has the advantage of not writing to
@@ -180,7 +191,7 @@ export declare class ExifTool {
180
191
  * @return a `Promise<Buffer>`. The promise will be rejected if the file or
181
192
  * tag is missing.
182
193
  */
183
- extractBinaryTagToBuffer(tagname: PreviewTag, imageFile: string): Promise<Buffer>;
194
+ extractBinaryTagToBuffer(tagname: PreviewTag, imageFile: string, opts?: ExifToolTaskOptions): Promise<Buffer>;
184
195
  /**
185
196
  * Attempt to fix metadata problems in JPEG images by deleting all metadata
186
197
  * and rebuilding from scratch. After repairing an image you should be able to
@@ -199,7 +210,9 @@ export declare class ExifTool {
199
210
  * exiftool's `-F` flag.
200
211
  * @return {Promise<void>} resolved when outputFile has been written.
201
212
  */
202
- rewriteAllTags(inputFile: string, outputFile: string, allowMakerNoteRepair?: boolean): Promise<void>;
213
+ rewriteAllTags(inputFile: string, outputFile: string, opts?: {
214
+ allowMakerNoteRepair?: boolean;
215
+ } & ExifToolTaskOptions): Promise<void>;
203
216
  /**
204
217
  * Shut down running ExifTool child processes. No subsequent requests will be
205
218
  * accepted.
package/dist/ExifTool.js CHANGED
@@ -30,9 +30,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
30
30
  var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
- var _ExifTool_checkForPerl;
33
+ var _ExifTool_taskOptions, _ExifTool_checkForPerl;
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.exiftool = exports.ExifTool = exports.DefaultWriteTaskOptions = exports.offsetMinutesToZoneName = exports.defaultVideosToUTC = exports.UnsetZoneOffsetMinutes = exports.UnsetZoneName = exports.UnsetZone = exports.DefaultReadTaskOptions = exports.parseJSON = exports.isGeolocationTag = exports.ExifToolTask = exports.ExifTime = exports.ExifDateTime = exports.ExifDate = exports.DefaultMaxProcs = exports.DefaultExiftoolArgs = exports.DefaultExifToolOptions = exports.CapturedAtTagNames = exports.BinaryField = void 0;
35
+ exports.exiftool = exports.ExifTool = exports.DefaultWriteTaskOptions = exports.offsetMinutesToZoneName = exports.defaultVideosToUTC = exports.UnsetZoneOffsetMinutes = exports.UnsetZoneName = exports.UnsetZone = exports.DefaultReadTaskOptions = exports.parseJSON = exports.isGeolocationTag = exports.exiftoolPath = exports.ExifToolTask = exports.ExifTime = exports.ExifDateTime = exports.ExifDate = exports.DefaultMaxProcs = exports.DefaultExiftoolArgs = exports.DefaultExifToolOptions = exports.CapturedAtTagNames = exports.BinaryField = void 0;
36
36
  const bc = __importStar(require("batch-cluster"));
37
37
  const _cp = __importStar(require("node:child_process"));
38
38
  const _fs = __importStar(require("node:fs"));
@@ -43,6 +43,7 @@ const BinaryToBufferTask_1 = require("./BinaryToBufferTask");
43
43
  const DefaultExifToolOptions_1 = require("./DefaultExifToolOptions");
44
44
  const DeleteAllTagsArgs_1 = require("./DeleteAllTagsArgs");
45
45
  const ExifToolOptions_1 = require("./ExifToolOptions");
46
+ const ExiftoolPath_1 = require("./ExiftoolPath");
46
47
  const IsWin32_1 = require("./IsWin32");
47
48
  const Lazy_1 = require("./Lazy");
48
49
  const Object_1 = require("./Object");
@@ -72,6 +73,8 @@ var ExifTime_1 = require("./ExifTime");
72
73
  Object.defineProperty(exports, "ExifTime", { enumerable: true, get: function () { return ExifTime_1.ExifTime; } });
73
74
  var ExifToolTask_1 = require("./ExifToolTask");
74
75
  Object.defineProperty(exports, "ExifToolTask", { enumerable: true, get: function () { return ExifToolTask_1.ExifToolTask; } });
76
+ var ExiftoolPath_2 = require("./ExiftoolPath");
77
+ Object.defineProperty(exports, "exiftoolPath", { enumerable: true, get: function () { return ExiftoolPath_2.exiftoolPath; } });
75
78
  var GeolocationTags_1 = require("./GeolocationTags");
76
79
  Object.defineProperty(exports, "isGeolocationTag", { enumerable: true, get: function () { return GeolocationTags_1.isGeolocationTag; } });
77
80
  var JSON_1 = require("./JSON");
@@ -86,6 +89,10 @@ Object.defineProperty(exports, "defaultVideosToUTC", { enumerable: true, get: fu
86
89
  Object.defineProperty(exports, "offsetMinutesToZoneName", { enumerable: true, get: function () { return Timezones_1.offsetMinutesToZoneName; } });
87
90
  var WriteTask_2 = require("./WriteTask");
88
91
  Object.defineProperty(exports, "DefaultWriteTaskOptions", { enumerable: true, get: function () { return WriteTask_2.DefaultWriteTaskOptions; } });
92
+ /**
93
+ * Is the #!/usr/bin/perl shebang line in exiftool-vendored.pl going to fail? If
94
+ * so, we need to find `perl` ourselves, and ignore the shebang line.
95
+ */
89
96
  const _ignoreShebang = (0, Lazy_1.lazy)(() => !(0, IsWin32_1.isWin32)() && !_fs.existsSync("/usr/bin/perl"));
90
97
  const whichPerl = (0, Lazy_1.lazy)(async () => {
91
98
  const result = await (0, Which_1.which)("perl");
@@ -97,12 +104,34 @@ const whichPerl = (0, Lazy_1.lazy)(async () => {
97
104
  /**
98
105
  * Manages delegating calls to a cluster of ExifTool child processes.
99
106
  *
100
- * Instances should be shared: consider using the exported singleton instance
101
- * of this class, {@link exiftool}.
107
+ * **NOTE: Instances are expensive!**
108
+ *
109
+ * * use either the default exported singleton instance of this class,
110
+ * {@link exiftool}, or your own singleton
111
+ *
112
+ * * make sure you await {@link ExifTool.end} when you're done with an instance
113
+ * to clean up subprocesses
114
+ *
115
+ * * review the {@link ExifToolOptions} for configuration options--the default
116
+ * values are conservative to avoid overwhelming your system.
117
+ *
118
+ * @see https://photostructure.github.io/exiftool-vendored.js/ for more documentation.
102
119
  */
103
120
  class ExifTool {
104
121
  constructor(options = {}) {
105
122
  var _a;
123
+ this.exiftoolPath = (0, Lazy_1.lazy)(async () => {
124
+ var _a;
125
+ const o = this.options;
126
+ return ((_a = (await ((0, Object_1.isFunction)(o.exiftoolPath)
127
+ ? o.exiftoolPath(this.options.logger())
128
+ : o.exiftoolPath))) !== null && _a !== void 0 ? _a : (0, ExiftoolPath_1.exiftoolPath)(this.options.logger()));
129
+ });
130
+ _ExifTool_taskOptions.set(this, (0, Lazy_1.lazy)(() => (0, Pick_1.pick)(this.options, "ignoreMinorErrors"))
131
+ /**
132
+ * Register life cycle event listeners. Delegates to BatchProcess.
133
+ */
134
+ );
106
135
  /**
107
136
  * Register life cycle event listeners. Delegates to BatchProcess.
108
137
  */
@@ -111,6 +140,8 @@ class ExifTool {
111
140
  * Unregister life cycle event listeners. Delegates to BatchProcess.
112
141
  */
113
142
  this.off = (event, listener) => this.batchCluster.off(event, listener);
143
+ // calling whichPerl through this lazy() means we only do that task once per
144
+ // instance.
114
145
  _ExifTool_checkForPerl.set(this, (0, Lazy_1.lazy)(async () => {
115
146
  if (this.options.checkPerl) {
116
147
  await whichPerl(); // < throws if perl is missing
@@ -141,7 +172,6 @@ class ExifTool {
141
172
  detached: false, // < no orphaned exiftool procs, please
142
173
  env,
143
174
  };
144
- this.exiftoolPath = (0, Lazy_1.lazy)(async () => (0, Object_1.isFunction)(o.exiftoolPath) ? o.exiftoolPath(o.logger()) : o.exiftoolPath);
145
175
  const processFactory = async () => ignoreShebang
146
176
  ? _cp.spawn(await whichPerl(), [await this.exiftoolPath(), ...o.exiftoolArgs], spawnOpts)
147
177
  : _cp.spawn(await this.exiftoolPath(), o.exiftoolArgs, spawnOpts);
@@ -156,7 +186,7 @@ class ExifTool {
156
186
  * @return a promise holding the version number of the vendored ExifTool
157
187
  */
158
188
  version() {
159
- return this.enqueueTask(() => new VersionTask_1.VersionTask());
189
+ return this.enqueueTask(() => new VersionTask_1.VersionTask(this.options));
160
190
  }
161
191
  /**
162
192
  * Read the tags in `file`.
@@ -207,7 +237,7 @@ class ExifTool {
207
237
  * typing details.
208
238
  */
209
239
  readRaw(file, args = []) {
210
- return this.enqueueTask(() => ReadRawTask_1.ReadRawTask.for(file, args));
240
+ return this.enqueueTask(() => ReadRawTask_1.ReadRawTask.for(file, args, __classPrivateFieldGet(this, _ExifTool_taskOptions, "f").call(this)));
211
241
  }
212
242
  /**
213
243
  * Write the given `tags` to `file`.
@@ -227,7 +257,7 @@ class ExifTool {
227
257
  // timestamps by an hour)
228
258
  const retriable = false;
229
259
  return this.enqueueTask(() => WriteTask_1.WriteTask.for(file, tags, args, {
230
- ...(0, Pick_1.pick)(this.options, "useMWG"),
260
+ ...(0, Pick_1.pick)(this.options, "useMWG", "ignoreMinorErrors"),
231
261
  ...options,
232
262
  }), retriable);
233
263
  }
@@ -248,7 +278,7 @@ class ExifTool {
248
278
  for (const ea of (_a = opts === null || opts === void 0 ? void 0 : opts.retain) !== null && _a !== void 0 ? _a : []) {
249
279
  args.push(`-${ea}<${ea}`);
250
280
  }
251
- return this.write(file, {}, args);
281
+ return this.write(file, {}, args, (0, Object_1.omit)(opts !== null && opts !== void 0 ? opts : {}, "retain"));
252
282
  }
253
283
  /**
254
284
  * Extract the low-resolution thumbnail in `path/to/image.jpg`
@@ -259,8 +289,8 @@ class ExifTool {
259
289
  * @return a `Promise<void>`. An `Error` is raised if
260
290
  * the file could not be read or the output not written.
261
291
  */
262
- extractThumbnail(imageFile, thumbnailFile) {
263
- return this.extractBinaryTag("ThumbnailImage", imageFile, thumbnailFile);
292
+ extractThumbnail(imageFile, thumbnailFile, opts) {
293
+ return this.extractBinaryTag("ThumbnailImage", imageFile, thumbnailFile, opts);
264
294
  }
265
295
  /**
266
296
  * Extract the "preview" image in `path/to/image.jpg`
@@ -272,8 +302,8 @@ class ExifTool {
272
302
  * @return a `Promise<void>`. An `Error` is raised if
273
303
  * the file could not be read or the output not written.
274
304
  */
275
- extractPreview(imageFile, previewFile) {
276
- return this.extractBinaryTag("PreviewImage", imageFile, previewFile);
305
+ extractPreview(imageFile, previewFile, opts) {
306
+ return this.extractBinaryTag("PreviewImage", imageFile, previewFile, opts);
277
307
  }
278
308
  /**
279
309
  * Extract the "JpgFromRaw" image in `path/to/image.jpg` and write it to
@@ -285,8 +315,8 @@ class ExifTool {
285
315
  * @return a `Promise<void>`. The promise will be rejected if the file could
286
316
  * not be read or the output not written.
287
317
  */
288
- extractJpgFromRaw(imageFile, outputFile) {
289
- return this.extractBinaryTag("JpgFromRaw", imageFile, outputFile);
318
+ extractJpgFromRaw(imageFile, outputFile, opts) {
319
+ return this.extractBinaryTag("JpgFromRaw", imageFile, outputFile, opts);
290
320
  }
291
321
  /**
292
322
  * Extract a given binary value from "tagname" tag associated to
@@ -296,10 +326,13 @@ class ExifTool {
296
326
  * @return a `Promise<void>`. The promise will be rejected if the binary
297
327
  * output not be written to `dest`.
298
328
  */
299
- async extractBinaryTag(tagname, src, dest) {
329
+ async extractBinaryTag(tagname, src, dest, opts) {
300
330
  // BinaryExtractionTask returns a stringified error if the output indicates
301
331
  // the task should not be retried.
302
- const maybeError = await this.enqueueTask(() => BinaryExtractionTask_1.BinaryExtractionTask.for(tagname, src, dest));
332
+ const maybeError = await this.enqueueTask(() => BinaryExtractionTask_1.BinaryExtractionTask.for(tagname, src, dest, {
333
+ ...__classPrivateFieldGet(this, _ExifTool_taskOptions, "f").call(this),
334
+ ...opts,
335
+ }));
303
336
  if (maybeError != null) {
304
337
  throw new Error(maybeError);
305
338
  }
@@ -313,8 +346,11 @@ class ExifTool {
313
346
  * @return a `Promise<Buffer>`. The promise will be rejected if the file or
314
347
  * tag is missing.
315
348
  */
316
- async extractBinaryTagToBuffer(tagname, imageFile) {
317
- const result = await this.enqueueTask(() => BinaryToBufferTask_1.BinaryToBufferTask.for(tagname, imageFile));
349
+ async extractBinaryTagToBuffer(tagname, imageFile, opts) {
350
+ const result = await this.enqueueTask(() => BinaryToBufferTask_1.BinaryToBufferTask.for(tagname, imageFile, {
351
+ ...__classPrivateFieldGet(this, _ExifTool_taskOptions, "f").call(this),
352
+ ...opts,
353
+ }));
318
354
  if (Buffer.isBuffer(result)) {
319
355
  return result;
320
356
  }
@@ -343,8 +379,12 @@ class ExifTool {
343
379
  * exiftool's `-F` flag.
344
380
  * @return {Promise<void>} resolved when outputFile has been written.
345
381
  */
346
- rewriteAllTags(inputFile, outputFile, allowMakerNoteRepair = false) {
347
- return this.enqueueTask(() => RewriteAllTagsTask_1.RewriteAllTagsTask.for(inputFile, outputFile, allowMakerNoteRepair));
382
+ rewriteAllTags(inputFile, outputFile, opts) {
383
+ return this.enqueueTask(() => RewriteAllTagsTask_1.RewriteAllTagsTask.for(inputFile, outputFile, {
384
+ allowMakerNoteRepair: false,
385
+ ...__classPrivateFieldGet(this, _ExifTool_taskOptions, "f").call(this),
386
+ ...opts,
387
+ }));
348
388
  }
349
389
  /**
350
390
  * Shut down running ExifTool child processes. No subsequent requests will be
@@ -417,7 +457,7 @@ class ExifTool {
417
457
  }
418
458
  }
419
459
  exports.ExifTool = ExifTool;
420
- _ExifTool_checkForPerl = new WeakMap();
460
+ _ExifTool_taskOptions = new WeakMap(), _ExifTool_checkForPerl = new WeakMap();
421
461
  /**
422
462
  * Use this singleton rather than instantiating new {@link ExifTool} instances
423
463
  * in order to leverage a single running ExifTool process.
@@ -1 +1 @@
1
- {"version":3,"file":"ExifTool.js","sourceRoot":"","sources":["../src/ExifTool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kD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AAC,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;AAraD,4BAqaC;;AAED;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA"}
@@ -56,8 +56,10 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
56
56
  * Allows for non-standard paths to ExifTool. Defaults to the perl or
57
57
  * windows binaries provided by `exiftool-vendored.pl` or
58
58
  * `exiftool-vendored.exe`.
59
+ *
60
+ * This must be the full path to `exiftool`, not just the directory.
59
61
  */
60
- exiftoolPath: string | ((logger?: bc.Logger) => string | Promise<string>);
62
+ exiftoolPath: string | Promise<string> | ((logger?: bc.Logger) => string | Promise<string>);
61
63
  /**
62
64
  * Args passed to exiftool on launch.
63
65
  */
@@ -196,6 +198,12 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
196
198
  * @see https://exiftool.org/geolocation.html
197
199
  */
198
200
  geolocation: boolean;
201
+ /**
202
+ * Should we ignore minor errors when reading metadata?
203
+ *
204
+ * This defaults to `true`, as ExifTool can be quite chatty.
205
+ */
206
+ ignoreMinorErrors: boolean;
199
207
  /**
200
208
  * `ExifTool` has a shebang line that assumes a valid `perl` is installed at
201
209
  * `/usr/bin/perl`.