exiftool-vendored 24.6.0 → 25.1.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.
- package/CHANGELOG.md +22 -0
- package/README.md +21 -0
- package/dist/DefaultExifToolOptions.js +3 -2
- package/dist/DefaultExifToolOptions.js.map +1 -1
- package/dist/ErrorsAndWarnings.js.map +1 -1
- package/dist/ExifTool.d.ts +13 -3
- package/dist/ExifTool.js +19 -9
- package/dist/ExifTool.js.map +1 -1
- package/dist/ExifToolOptions.d.ts +36 -19
- package/dist/ExifToolOptions.js.map +1 -1
- package/dist/ExifToolTags.d.ts +7 -0
- package/dist/ExifToolTags.js +20 -0
- package/dist/ExifToolTags.js.map +1 -0
- package/dist/ExifToolVendoredTags.d.ts +23 -0
- package/dist/ExifToolVendoredTags.js +19 -0
- package/dist/ExifToolVendoredTags.js.map +1 -0
- package/dist/ExiftoolPath.d.ts +2 -0
- package/dist/ExiftoolPath.js +86 -0
- package/dist/ExiftoolPath.js.map +1 -0
- package/dist/FileTags.d.ts +6 -0
- package/dist/FileTags.js +41 -0
- package/dist/FileTags.js.map +1 -0
- package/dist/GeoTz.d.ts +3 -0
- package/dist/GeoTz.js +4 -6
- package/dist/GeoTz.js.map +1 -1
- package/dist/GeolocationTags.d.ts +43 -0
- package/dist/GeolocationTags.js +26 -0
- package/dist/GeolocationTags.js.map +1 -0
- package/dist/Object.d.ts +10 -0
- package/dist/Object.js +14 -1
- package/dist/Object.js.map +1 -1
- package/dist/ReadTask.d.ts +2 -9
- package/dist/ReadTask.js +103 -72
- package/dist/ReadTask.js.map +1 -1
- package/dist/String.d.ts +1 -0
- package/dist/String.js +8 -1
- package/dist/String.js.map +1 -1
- package/dist/Tags.d.ts +125 -72
- package/dist/TimeParsing.js +1 -1
- package/dist/TimeParsing.js.map +1 -1
- package/dist/Timezones.js +1 -0
- package/dist/Timezones.js.map +1 -1
- package/package.json +17 -13
- package/dist/FindExiftool.d.ts +0 -1
- package/dist/FindExiftool.js +0 -54
- package/dist/FindExiftool.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -26,6 +26,28 @@ vendored versions of ExifTool match the version that they vendor.
|
|
|
26
26
|
|
|
27
27
|
## Version history
|
|
28
28
|
|
|
29
|
+
### v25.1.0
|
|
30
|
+
|
|
31
|
+
- ✨ 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)
|
|
32
|
+
|
|
33
|
+
- 📦 Added jsdocs for many `Tag` interface types
|
|
34
|
+
|
|
35
|
+
- 📦 Expose `GeolocationTags` and `isGeolocationTag()`
|
|
36
|
+
|
|
37
|
+
- 📦 Add `FileTags.FileCreateDate` (only a thing on Windows)
|
|
38
|
+
|
|
39
|
+
### v25.0.0
|
|
40
|
+
|
|
41
|
+
- 🌱/✨ ExifTool upgraded to [v12.80](https://exiftool.org/history.html#v12.80), which **adds support for reverse-geo lookups** and [several other geolocation features](https://exiftool.org/geolocation.html
|
|
42
|
+
|
|
43
|
+
- ✨ If no vendored version of `exiftool` is available, we'll try to make do with whatever is available in the `PATH`.
|
|
44
|
+
|
|
45
|
+
- ✨ `ExifToolOptions.exiftoolPath` can now be an `async` function
|
|
46
|
+
|
|
47
|
+
- ✨ Added [Geolocation](https://photostructure.github.io/exiftool-vendored.js/interfaces/GeolocationTags.html) Tags. These will only be available if `{geolocation: true}` is passed to the [ExifTool constructor](https://photostructure.github.io/exiftool-vendored.js/classes/ExifTool.html#constructor).
|
|
48
|
+
|
|
49
|
+
- 📦 Added support for `electron-forge`: [see the docs for details](https://photostructure.github.io/exiftool-vendored.js/#md:electron-forge-support).
|
|
50
|
+
|
|
29
51
|
### v24.6.0
|
|
30
52
|
|
|
31
53
|
- 🌱 ExifTool upgraded to [v12.78](https://exiftool.org/history.html#v12.78)
|
package/README.md
CHANGED
|
@@ -44,6 +44,25 @@ or
|
|
|
44
44
|
|
|
45
45
|
npm install --save exiftool-vendored
|
|
46
46
|
|
|
47
|
+
### Electron-builder support
|
|
48
|
+
|
|
49
|
+
Add the following pattern to `electron-builder.yml`'s `asarUnpack`:
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
- "node_modules/exiftool-vendored.*/**/*"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Electron-forge support
|
|
56
|
+
|
|
57
|
+
Version 25.0 of this library added experimental support for `electron-forge`:
|
|
58
|
+
add the following element to your `ForgeConfig.packagerConfig.extraResource`
|
|
59
|
+
string array, and things should "just work":
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
"./node_modules/exiftool-vendored." +
|
|
63
|
+
(process.platform === "win32" ? "exe" : "pl")
|
|
64
|
+
```
|
|
65
|
+
|
|
47
66
|
### Installation notes
|
|
48
67
|
|
|
49
68
|
- `exiftool-vendored` provides an installation of ExifTool relevant for your
|
|
@@ -58,6 +77,8 @@ or
|
|
|
58
77
|
|
|
59
78
|
- Node.js's `-slim` docker images don't include a working `perl` build. Use the non-slim image instead. [See the issue report for details.](https://github.com/photostructure/exiftool-vendored.js/issues/168)
|
|
60
79
|
|
|
80
|
+
- If the platform-correct vendor module (`exiftool-vendored.exe` or `exiftool-vendored.pl`) is not found, `exiftool` is searched for on your `PATH`. Note that _very_ old versions of `exiftool` are found on currently-supported Linux distributions which this library will not work correctly with.
|
|
81
|
+
|
|
61
82
|
## Upgrading
|
|
62
83
|
|
|
63
84
|
See the
|
|
@@ -28,7 +28,7 @@ const bc = __importStar(require("batch-cluster"));
|
|
|
28
28
|
const CapturedAtTagNames_1 = require("./CapturedAtTagNames");
|
|
29
29
|
const DefaultExiftoolArgs_1 = require("./DefaultExiftoolArgs");
|
|
30
30
|
const DefaultMaxProcs_1 = require("./DefaultMaxProcs");
|
|
31
|
-
const
|
|
31
|
+
const ExiftoolPath_1 = require("./ExiftoolPath");
|
|
32
32
|
const GeoTz_1 = require("./GeoTz");
|
|
33
33
|
const IsWin32_1 = require("./IsWin32");
|
|
34
34
|
const VersionTask_1 = require("./VersionTask");
|
|
@@ -45,7 +45,7 @@ exports.DefaultExifToolOptions = Object.freeze({
|
|
|
45
45
|
taskTimeoutMillis: 20000,
|
|
46
46
|
onIdleIntervalMillis: 2000,
|
|
47
47
|
taskRetries: 1,
|
|
48
|
-
exiftoolPath:
|
|
48
|
+
exiftoolPath: ExiftoolPath_1.exiftoolPath,
|
|
49
49
|
exiftoolArgs: DefaultExiftoolArgs_1.DefaultExiftoolArgs,
|
|
50
50
|
exiftoolEnv: {},
|
|
51
51
|
checkPerl: !(0, IsWin32_1.isWin32)(),
|
|
@@ -58,6 +58,7 @@ exports.DefaultExifToolOptions = Object.freeze({
|
|
|
58
58
|
backfillTimezones: true,
|
|
59
59
|
defaultVideosToUTC: true,
|
|
60
60
|
geoTz: GeoTz_1.geoTz,
|
|
61
|
+
geolocation: false,
|
|
61
62
|
ignoreZeroZeroLatLon: true,
|
|
62
63
|
imageHashType: false,
|
|
63
64
|
includeImageDataMD5: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultExifToolOptions.js","sourceRoot":"","sources":["../src/DefaultExifToolOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,6DAAyD;AACzD,+DAA2D;AAC3D,uDAAmD;AAEnD,
|
|
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;AAEnC,+CAA2C;AAE3C;;;GAGG;AACU,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,EAAZ,2BAAY;IACZ,YAAY,EAAE,yCAAmB;IACjC,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,CAAC,IAAA,iBAAO,GAAE;IACrB,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;IAEtC,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,KAAK,EAAE,aAAK;IACZ,WAAW,EAAE,KAAK;IAClB,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,SAAS;IAC9B,2BAA2B,EAAE,KAAK,EAAE,2BAA2B;IAC/D,8BAA8B,EAAE,CAAC,GAAG,uCAAkB,CAAC;IACvD,WAAW,EAAE;QACX,YAAY;QACZ,aAAa;QACb,aAAa;QACb,cAAc;QACd,aAAa;QACb,aAAa;KACd;IACD,MAAM,EAAE,KAAK;CACd,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorsAndWarnings.js","sourceRoot":"","sources":["../src/ErrorsAndWarnings.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAE9B,qCAAwC;
|
|
1
|
+
{"version":3,"file":"ErrorsAndWarnings.js","sourceRoot":"","sources":["../src/ErrorsAndWarnings.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAE9B,qCAAwC;AAkBxC,SAAgB,iBAAiB,CAC/B,IAAuB,EACvB,CAAwC;IAExC,OAAO;QACL,MAAM,EAAE,IAAA,YAAI,EAAC,IAAA,sBAAa,EAAC,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,QAAQ,EAAE,IAAA,YAAI,EAAC,IAAA,sBAAa,EAAC,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC9D,CAAA;AACH,CAAC;AARD,8CAQC"}
|
package/dist/ExifTool.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Defined, DefinedOrNullValued } from "./Defined";
|
|
|
5
5
|
import { ErrorsAndWarnings } from "./ErrorsAndWarnings";
|
|
6
6
|
import { ExifToolOptions } from "./ExifToolOptions";
|
|
7
7
|
import { ExifToolTask } from "./ExifToolTask";
|
|
8
|
+
import { ExifToolVendoredTags } from "./ExifToolVendoredTags";
|
|
8
9
|
import { ICCProfileTags } from "./ICCProfileTags";
|
|
9
10
|
import { CollectionInfo, KeywordInfoStruct, KeywordStruct, MWGCollectionsTags, MWGKeywordTags } from "./MWGTags";
|
|
10
11
|
import { Maybe } from "./Maybe";
|
|
@@ -15,7 +16,7 @@ import { ReadTaskOptions } from "./ReadTask";
|
|
|
15
16
|
import { ResourceEvent } from "./ResourceEvent";
|
|
16
17
|
import { ShortcutTags } from "./ShortcutTags";
|
|
17
18
|
import { Struct } from "./Struct";
|
|
18
|
-
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";
|
|
19
|
+
import { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, CompositeTags, EXIFTags, ExifToolTags, FileTags, FlashPixTags, GeolocationTags, IPTCTags, JFIFTags, MPFTags, MakerNotesTags, MetaTags, PanasonicRawTags, PhotoshopTags, PrintIMTags, QuickTimeTags, RAFTags, RIFFTags, Tags, XMPTags } from "./Tags";
|
|
19
20
|
import { Version } from "./Version";
|
|
20
21
|
import { AdditionalWriteTags, ExpandedDateTags, MutableTags, StructAppendTags, WriteTags } from "./WriteTags";
|
|
21
22
|
import { WriteTaskOptions, WriteTaskResult } from "./WriteTask";
|
|
@@ -28,11 +29,12 @@ export { ExifDate } from "./ExifDate";
|
|
|
28
29
|
export { ExifDateTime } from "./ExifDateTime";
|
|
29
30
|
export { ExifTime } from "./ExifTime";
|
|
30
31
|
export { ExifToolTask } from "./ExifToolTask";
|
|
32
|
+
export { isGeolocationTag } from "./GeolocationTags";
|
|
31
33
|
export { parseJSON } from "./JSON";
|
|
32
34
|
export { DefaultReadTaskOptions } from "./ReadTask";
|
|
33
35
|
export { UnsetZone, UnsetZoneName, UnsetZoneOffsetMinutes, defaultVideosToUTC, offsetMinutesToZoneName, } from "./Timezones";
|
|
34
36
|
export { DefaultWriteTaskOptions } from "./WriteTask";
|
|
35
|
-
export type { APP12Tags, APP14Tags, APP1Tags, APP4Tags, APP5Tags, APP6Tags, AdditionalWriteTags, ApplicationRecordTags, CollectionInfo, CompositeTags, Defined, DefinedOrNullValued, EXIFTags, ErrorsAndWarnings, ExifToolOptions, ExifToolTags, ExpandedDateTags, FileTags, FlashPixTags, 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, };
|
|
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, };
|
|
36
38
|
/**
|
|
37
39
|
* Manages delegating calls to a cluster of ExifTool child processes.
|
|
38
40
|
*
|
|
@@ -43,6 +45,7 @@ export declare class ExifTool {
|
|
|
43
45
|
#private;
|
|
44
46
|
readonly options: ExifToolOptions;
|
|
45
47
|
private readonly batchCluster;
|
|
48
|
+
readonly exiftoolPath: () => Promise<string>;
|
|
46
49
|
constructor(options?: Partial<ExifToolOptions>);
|
|
47
50
|
/**
|
|
48
51
|
* Register life cycle event listeners. Delegates to BatchProcess.
|
|
@@ -118,8 +121,15 @@ export declare class ExifTool {
|
|
|
118
121
|
* name `${FILENAME}_original`) will be retained. Note that some tags, like
|
|
119
122
|
* stat information and image dimensions, are intrinsic to the file and will
|
|
120
123
|
* continue to exist if you re-`read` the file.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} file the file to strip of metadata
|
|
126
|
+
*
|
|
127
|
+
* @param {(keyof Tags | string)[]} opts.retain optional. If provided, this is
|
|
128
|
+
* a list of metadata keys to **not** delete.
|
|
121
129
|
*/
|
|
122
|
-
deleteAllTags(file: string
|
|
130
|
+
deleteAllTags(file: string, opts?: {
|
|
131
|
+
retain?: (keyof Tags | string)[];
|
|
132
|
+
}): Promise<WriteTaskResult>;
|
|
123
133
|
/**
|
|
124
134
|
* Extract the low-resolution thumbnail in `path/to/image.jpg`
|
|
125
135
|
* and write it to `path/to/thumbnail.jpg`.
|
package/dist/ExifTool.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
};
|
|
33
33
|
var _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.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.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"));
|
|
@@ -45,6 +45,7 @@ const DeleteAllTagsArgs_1 = require("./DeleteAllTagsArgs");
|
|
|
45
45
|
const ExifToolOptions_1 = require("./ExifToolOptions");
|
|
46
46
|
const IsWin32_1 = require("./IsWin32");
|
|
47
47
|
const Lazy_1 = require("./Lazy");
|
|
48
|
+
const Object_1 = require("./Object");
|
|
48
49
|
const Pick_1 = require("./Pick");
|
|
49
50
|
const ReadRawTask_1 = require("./ReadRawTask");
|
|
50
51
|
const ReadTask_1 = require("./ReadTask");
|
|
@@ -71,6 +72,8 @@ var ExifTime_1 = require("./ExifTime");
|
|
|
71
72
|
Object.defineProperty(exports, "ExifTime", { enumerable: true, get: function () { return ExifTime_1.ExifTime; } });
|
|
72
73
|
var ExifToolTask_1 = require("./ExifToolTask");
|
|
73
74
|
Object.defineProperty(exports, "ExifToolTask", { enumerable: true, get: function () { return ExifToolTask_1.ExifToolTask; } });
|
|
75
|
+
var GeolocationTags_1 = require("./GeolocationTags");
|
|
76
|
+
Object.defineProperty(exports, "isGeolocationTag", { enumerable: true, get: function () { return GeolocationTags_1.isGeolocationTag; } });
|
|
74
77
|
var JSON_1 = require("./JSON");
|
|
75
78
|
Object.defineProperty(exports, "parseJSON", { enumerable: true, get: function () { return JSON_1.parseJSON; } });
|
|
76
79
|
var ReadTask_2 = require("./ReadTask");
|
|
@@ -138,17 +141,14 @@ class ExifTool {
|
|
|
138
141
|
detached: false, // < no orphaned exiftool procs, please
|
|
139
142
|
env,
|
|
140
143
|
};
|
|
144
|
+
this.exiftoolPath = (0, Lazy_1.lazy)(async () => (0, Object_1.isFunction)(o.exiftoolPath) ? o.exiftoolPath(o.logger()) : o.exiftoolPath);
|
|
141
145
|
const processFactory = async () => ignoreShebang
|
|
142
|
-
? _cp.spawn(await whichPerl(), [
|
|
143
|
-
: _cp.spawn(
|
|
146
|
+
? _cp.spawn(await whichPerl(), [await this.exiftoolPath(), ...o.exiftoolArgs], spawnOpts)
|
|
147
|
+
: _cp.spawn(await this.exiftoolPath(), o.exiftoolArgs, spawnOpts);
|
|
144
148
|
this.options = {
|
|
145
149
|
...o,
|
|
146
150
|
ignoreShebang,
|
|
147
151
|
processFactory,
|
|
148
|
-
exitCommand: o.exitCommand,
|
|
149
|
-
versionCommand: o.versionCommand,
|
|
150
|
-
// User options win:
|
|
151
|
-
...options,
|
|
152
152
|
};
|
|
153
153
|
this.batchCluster = new bc.BatchCluster(this.options);
|
|
154
154
|
}
|
|
@@ -236,9 +236,19 @@ class ExifTool {
|
|
|
236
236
|
* name `${FILENAME}_original`) will be retained. Note that some tags, like
|
|
237
237
|
* stat information and image dimensions, are intrinsic to the file and will
|
|
238
238
|
* continue to exist if you re-`read` the file.
|
|
239
|
+
*
|
|
240
|
+
* @param {string} file the file to strip of metadata
|
|
241
|
+
*
|
|
242
|
+
* @param {(keyof Tags | string)[]} opts.retain optional. If provided, this is
|
|
243
|
+
* a list of metadata keys to **not** delete.
|
|
239
244
|
*/
|
|
240
|
-
deleteAllTags(file) {
|
|
241
|
-
|
|
245
|
+
deleteAllTags(file, opts) {
|
|
246
|
+
var _a;
|
|
247
|
+
const args = [...DeleteAllTagsArgs_1.DeleteAllTagsArgs];
|
|
248
|
+
for (const ea of (_a = opts === null || opts === void 0 ? void 0 : opts.retain) !== null && _a !== void 0 ? _a : []) {
|
|
249
|
+
args.push(`-${ea}<${ea}`);
|
|
250
|
+
}
|
|
251
|
+
return this.write(file, {}, args);
|
|
242
252
|
}
|
|
243
253
|
/**
|
|
244
254
|
* Extract the low-resolution thumbnail in `path/to/image.jpg`
|
package/dist/ExifTool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExifTool.js","sourceRoot":"","sources":["../src/ExifTool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,wDAAyC;AACzC,6CAA8B;AAC9B,gEAAkC;AAElC,6CAA4C;AAC5C,iEAA6D;AAC7D,6DAAyD;AACzD,qEAAiE;AAEjE,2DAAuD;AAEvD,uDAA4E;
|
|
1
|
+
{"version":3,"file":"ExifTool.js","sourceRoot":"","sources":["../src/ExifTool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,wDAAyC;AACzC,6CAA8B;AAC9B,gEAAkC;AAElC,6CAA4C;AAC5C,iEAA6D;AAC7D,6DAA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C,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;AA7XD,4BA6XC;;AAED;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA"}
|
|
@@ -57,7 +57,7 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
|
|
|
57
57
|
* windows binaries provided by `exiftool-vendored.pl` or
|
|
58
58
|
* `exiftool-vendored.exe`.
|
|
59
59
|
*/
|
|
60
|
-
exiftoolPath: string;
|
|
60
|
+
exiftoolPath: string | ((logger?: bc.Logger) => string | Promise<string>);
|
|
61
61
|
/**
|
|
62
62
|
* Args passed to exiftool on launch.
|
|
63
63
|
*/
|
|
@@ -159,32 +159,24 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
|
|
|
159
159
|
* this option is true, and GPSLatitude and GPSLongitude are both 0, then
|
|
160
160
|
* those values will be returned, but the TZ will not be inferred from that
|
|
161
161
|
* location.
|
|
162
|
-
*/
|
|
163
|
-
ignoreZeroZeroLatLon: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* `ExifTool` has a shebang line that assumes a valid `perl` is installed at
|
|
166
|
-
* `/usr/bin/perl`.
|
|
167
162
|
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* `/opt/bin/perl`), if you pull in a perl layer.
|
|
163
|
+
* If both this and {@link geolocation} are `true`, we will _delete_ the
|
|
164
|
+
* Geolocation tags from the returned metadata object.
|
|
171
165
|
*
|
|
172
|
-
*
|
|
173
|
-
* situations. Note also that `perl` will be spawned in a sub-shell.
|
|
166
|
+
* @see https://en.wikipedia.org/wiki/Null_Island
|
|
174
167
|
*/
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Should we check for a readable and executable `perl` file in $PATH? This
|
|
178
|
-
* defaults to false on Windows, and true everywhere else. Set this to false
|
|
179
|
-
* if you know perl is installed.
|
|
180
|
-
*/
|
|
181
|
-
checkPerl: boolean;
|
|
168
|
+
ignoreZeroZeroLatLon: boolean;
|
|
182
169
|
/**
|
|
183
|
-
* Override the default geo-to-timezone lookup service.
|
|
170
|
+
* Override the default geo-to-timezone lookup service. Note that if
|
|
171
|
+
{@link geolocation} is enabled, we'll use
|
|
172
|
+
{@link Tags.GeolocationTimeZone} if it's not blank.
|
|
184
173
|
*
|
|
185
174
|
* This defaults to `@photostructure/tz-lookup`, but if you have the
|
|
186
175
|
* resources, consider using `geo-tz` for more accurate results.
|
|
187
176
|
*
|
|
177
|
+
* If your implementation throws an error, `ExifTool` will consider that given
|
|
178
|
+
* latitude/longitude as invalid.
|
|
179
|
+
*
|
|
188
180
|
* Here's a snippet of how to use `geo-tz` instead of `tz-lookup`:
|
|
189
181
|
*
|
|
190
182
|
```js
|
|
@@ -197,5 +189,30 @@ export interface ExifToolOptions extends bc.BatchClusterOptions, bc.BatchProcess
|
|
|
197
189
|
* @see https://github.com/evansiroky/node-geo-tz/
|
|
198
190
|
*/
|
|
199
191
|
geoTz: typeof geoTz;
|
|
192
|
+
/**
|
|
193
|
+
* When reading metadata, should we enable ExifTool's geolocation features?
|
|
194
|
+
* Note that this requires ExifTool version 12.78 or later.
|
|
195
|
+
*
|
|
196
|
+
* @see https://exiftool.org/geolocation.html
|
|
197
|
+
*/
|
|
198
|
+
geolocation: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* `ExifTool` has a shebang line that assumes a valid `perl` is installed at
|
|
201
|
+
* `/usr/bin/perl`.
|
|
202
|
+
*
|
|
203
|
+
* Some environments may not include a valid `/usr/bin/perl` (like AWS
|
|
204
|
+
* Lambda), but `perl` may be available in your `PATH` some place else (like
|
|
205
|
+
* `/opt/bin/perl`), if you pull in a perl layer.
|
|
206
|
+
*
|
|
207
|
+
* This will default to `true` in those environments as a workaround in these
|
|
208
|
+
* situations. Note also that `perl` will be spawned in a sub-shell.
|
|
209
|
+
*/
|
|
210
|
+
ignoreShebang: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Should we check for a readable and executable `perl` file in $PATH? This
|
|
213
|
+
* defaults to false on Windows, and true everywhere else. Set this to false
|
|
214
|
+
* if you know perl is installed.
|
|
215
|
+
*/
|
|
216
|
+
checkPerl: boolean;
|
|
200
217
|
}
|
|
201
218
|
export declare function handleDeprecatedOptions<T extends Pick<ExifToolOptions, "includeImageDataMD5" | "imageHashType">>(options: T): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExifToolOptions.js","sourceRoot":"","sources":["../src/ExifToolOptions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ExifToolOptions.js","sourceRoot":"","sources":["../src/ExifToolOptions.ts"],"names":[],"mappings":";;;AAkPA,SAAgB,uBAAuB,CAErC,OAAU;IACV,IAAI,OAAO,CAAC,aAAa,IAAI,IAAI,IAAI,OAAO,CAAC,mBAAmB,IAAI,IAAI,EAAE,CAAC;QACzE,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;IACrE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAPD,0DAOC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExifToolTags } from "./Tags";
|
|
2
|
+
export declare const ExifToolTagNames: (keyof ExifToolTags)[];
|
|
3
|
+
/**
|
|
4
|
+
* Is the given tag name intrinsic to the content of a given file? In other
|
|
5
|
+
* words, is it not an artifact of a metadata field?
|
|
6
|
+
*/
|
|
7
|
+
export declare function isExifToolTag(name: string): name is keyof ExifToolTags;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isExifToolTag = exports.ExifToolTagNames = void 0;
|
|
5
|
+
const Object_1 = require("./Object");
|
|
6
|
+
exports.ExifToolTagNames = (0, Object_1.keysOf)({
|
|
7
|
+
ExifToolVersion: true,
|
|
8
|
+
SourceFile: true,
|
|
9
|
+
Error: true,
|
|
10
|
+
Warning: true,
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Is the given tag name intrinsic to the content of a given file? In other
|
|
14
|
+
* words, is it not an artifact of a metadata field?
|
|
15
|
+
*/
|
|
16
|
+
function isExifToolTag(name) {
|
|
17
|
+
return exports.ExifToolTagNames.includes(name);
|
|
18
|
+
}
|
|
19
|
+
exports.isExifToolTag = isExifToolTag;
|
|
20
|
+
//# sourceMappingURL=ExifToolTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExifToolTags.js","sourceRoot":"","sources":["../src/ExifToolTags.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;AAEvD,qCAAiC;AAGpB,QAAA,gBAAgB,GAAG,IAAA,eAAM,EAAe;IACnD,eAAe,EAAE,IAAI;IACrB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAEF;;;GAGG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,wBAAgB,CAAC,QAAQ,CAAC,IAAW,CAAC,CAAA;AAC/C,CAAC;AAFD,sCAEC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ErrorsAndWarnings } from "./ErrorsAndWarnings";
|
|
2
|
+
/**
|
|
3
|
+
* This tags are added to {@link Tags} from this library.
|
|
4
|
+
*/
|
|
5
|
+
export interface ExifToolVendoredTags extends ErrorsAndWarnings {
|
|
6
|
+
/**
|
|
7
|
+
* Either an offset, like `UTC-7`, or an actual IANA timezone, like
|
|
8
|
+
* `America/Los_Angeles`.
|
|
9
|
+
*
|
|
10
|
+
* This will be missing if we can't intuit a timezone from the metadata.
|
|
11
|
+
*/
|
|
12
|
+
tz?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Description of where and how `tz` was extracted
|
|
15
|
+
*/
|
|
16
|
+
tzSource?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ExifToolVendoredTagNames: (keyof ExifToolVendoredTags)[];
|
|
19
|
+
/**
|
|
20
|
+
* Is the given tag name intrinsic to the content of a given file? In other
|
|
21
|
+
* words, is it not an artifact of a metadata field?
|
|
22
|
+
*/
|
|
23
|
+
export declare function isExifToolVendoredTag(name: string): name is keyof ExifToolVendoredTags;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isExifToolVendoredTag = exports.ExifToolVendoredTagNames = void 0;
|
|
4
|
+
const Object_1 = require("./Object");
|
|
5
|
+
exports.ExifToolVendoredTagNames = (0, Object_1.keysOf)({
|
|
6
|
+
tz: true,
|
|
7
|
+
tzSource: true,
|
|
8
|
+
errors: true,
|
|
9
|
+
warnings: true,
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Is the given tag name intrinsic to the content of a given file? In other
|
|
13
|
+
* words, is it not an artifact of a metadata field?
|
|
14
|
+
*/
|
|
15
|
+
function isExifToolVendoredTag(name) {
|
|
16
|
+
return exports.ExifToolVendoredTagNames.includes(name);
|
|
17
|
+
}
|
|
18
|
+
exports.isExifToolVendoredTag = isExifToolVendoredTag;
|
|
19
|
+
//# sourceMappingURL=ExifToolVendoredTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExifToolVendoredTags.js","sourceRoot":"","sources":["../src/ExifToolVendoredTags.ts"],"names":[],"mappings":";;;AACA,qCAAiC;AAoBpB,QAAA,wBAAwB,GAAG,IAAA,eAAM,EAAuB;IACnE,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;CACf,CAAC,CAAA;AAEF;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,IAAY;IAEZ,OAAO,gCAAwB,CAAC,QAAQ,CAAC,IAAW,CAAC,CAAA;AACvD,CAAC;AAJD,sDAIC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.exiftoolPath = void 0;
|
|
30
|
+
const _fs = __importStar(require("node:fs"));
|
|
31
|
+
const _path = __importStar(require("node:path"));
|
|
32
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
33
|
+
const IsWin32_1 = require("./IsWin32");
|
|
34
|
+
const Which_1 = require("./Which");
|
|
35
|
+
function vendorPackage() {
|
|
36
|
+
return "exiftool-vendored." + ((0, IsWin32_1.isWin32)() ? "exe" : "pl");
|
|
37
|
+
}
|
|
38
|
+
function tryRequire({ prefix = "", logger, } = {}) {
|
|
39
|
+
const id = prefix + vendorPackage();
|
|
40
|
+
try {
|
|
41
|
+
return require(id);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
logger === null || logger === void 0 ? void 0 : logger.warn(id + "not found: ", error);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function exiftoolPath(logger) {
|
|
49
|
+
const path = tryRequire({ prefix: "", logger });
|
|
50
|
+
// This s/app.asar/app.asar.unpacked/ path switch adds support for Electron
|
|
51
|
+
// apps that are ASAR-packed (like by electron-builder). This is necessary because
|
|
52
|
+
// Note that we can't reliably automatically detect that we're running in
|
|
53
|
+
// electron because child processes that are spawned by the main process will
|
|
54
|
+
// most likely need the ELECTRON_RUN_AS_NODE environment variable set, which
|
|
55
|
+
// will unset the process.versions.electron field.
|
|
56
|
+
const fixedPath = path === null || path === void 0 ? void 0 : path.split(_path.sep).map((ea) => (ea === "app.asar" ? "app.asar.unpacked" : ea)).join(_path.sep);
|
|
57
|
+
// Note also, that we must check for the fixedPath first, because Electron's
|
|
58
|
+
// ASAR shenanigans will make existsSync return true even for asar-packed
|
|
59
|
+
// resources.
|
|
60
|
+
if (fixedPath != null && _fs.existsSync(fixedPath)) {
|
|
61
|
+
return fixedPath;
|
|
62
|
+
}
|
|
63
|
+
if (path != null && _fs.existsSync(path)) {
|
|
64
|
+
return path;
|
|
65
|
+
}
|
|
66
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("Failed to find exiftool via " + vendorPackage());
|
|
67
|
+
// Set by electron-forge:
|
|
68
|
+
const electronResourcePath = node_process_1.default.resourcesPath;
|
|
69
|
+
if (electronResourcePath != null) {
|
|
70
|
+
const forgePath = _path.join(electronResourcePath, vendorPackage(), "bin", "exiftool" + ((0, IsWin32_1.isWin32)() ? ".exe" : ""));
|
|
71
|
+
if (_fs.existsSync(forgePath)) {
|
|
72
|
+
return forgePath;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("Failed to find exiftool in electron forge resources path: " + forgePath);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Last ditch: is there a globally installed exiftool in the PATH?
|
|
79
|
+
const fromPath = await (0, Which_1.which)("exiftool");
|
|
80
|
+
if (fromPath != null) {
|
|
81
|
+
return fromPath;
|
|
82
|
+
}
|
|
83
|
+
throw new Error(`Failed to find ExifTool installation: set exiftoolPath explicitly.`);
|
|
84
|
+
}
|
|
85
|
+
exports.exiftoolPath = exiftoolPath;
|
|
86
|
+
//# sourceMappingURL=ExiftoolPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExiftoolPath.js","sourceRoot":"","sources":["../src/ExiftoolPath.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA8B;AAC9B,iDAAkC;AAClC,gEAAkC;AAClC,uCAAmC;AAEnC,mCAA+B;AAE/B,SAAS,aAAa;IACpB,OAAO,oBAAoB,GAAG,CAAC,IAAA,iBAAO,GAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,UAAU,CAAC,EAClB,MAAM,GAAG,EAAE,EACX,MAAM,MACyC,EAAE;IACjD,MAAM,EAAE,GAAG,MAAM,GAAG,aAAa,EAAE,CAAA;IACnC,IAAI,CAAC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AC1B,oBAAoB,EACpB,aAAa,EAAE,EACf,KAAK,EACL,UAAU,GAAG,CAAC,IAAA,iBAAO,GAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CACvC,CAAA;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAA;QAClB,CAAC;aAAM,CAAC;YACN,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CACV,4DAA4D,GAAG,SAAS,CACzE,CAAA;QACH,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,MAAM,QAAQ,GAAG,MAAM,IAAA,aAAK,EAAC,UAAU,CAAC,CAAA;IACxC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAA;AACH,CAAC;AApDD,oCAoDC"}
|
package/dist/FileTags.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFileTag = void 0;
|
|
4
|
+
const Object_1 = require("./Object");
|
|
5
|
+
const FileTagNames = (0, Object_1.keysOf)({
|
|
6
|
+
BMPVersion: true,
|
|
7
|
+
BitsPerSample: true,
|
|
8
|
+
ColorComponents: true,
|
|
9
|
+
CurrentIPTCDigest: true,
|
|
10
|
+
Directory: true,
|
|
11
|
+
EncodingProcess: true,
|
|
12
|
+
ExifByteOrder: true,
|
|
13
|
+
FileAccessDate: true,
|
|
14
|
+
FileCreateDate: true,
|
|
15
|
+
FileInodeChangeDate: true,
|
|
16
|
+
FileModifyDate: true,
|
|
17
|
+
FileName: true,
|
|
18
|
+
FilePermissions: true,
|
|
19
|
+
FileSize: true,
|
|
20
|
+
FileType: true,
|
|
21
|
+
FileTypeExtension: true,
|
|
22
|
+
ImageDataMD5: true,
|
|
23
|
+
ImageHeight: true,
|
|
24
|
+
ImageWidth: true,
|
|
25
|
+
MIMEType: true,
|
|
26
|
+
NumColors: true,
|
|
27
|
+
NumImportantColors: true,
|
|
28
|
+
PixelsPerMeterX: true,
|
|
29
|
+
PixelsPerMeterY: true,
|
|
30
|
+
Planes: true,
|
|
31
|
+
YCbCrSubSampling: true,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Is the given tag name intrinsic to the content of a given file? In other
|
|
35
|
+
* words, is it not an artifact of a metadata field?
|
|
36
|
+
*/
|
|
37
|
+
function isFileTag(name) {
|
|
38
|
+
return FileTagNames.includes(name);
|
|
39
|
+
}
|
|
40
|
+
exports.isFileTag = isFileTag;
|
|
41
|
+
//# sourceMappingURL=FileTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTags.js","sourceRoot":"","sources":["../src/FileTags.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAGjC,MAAM,YAAY,GAAG,IAAA,eAAM,EAAW;IACpC,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,IAAI;IACvB,SAAS,EAAE,IAAI;IACf,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,IAAI;IACzB,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,IAAI;IACd,eAAe,EAAE,IAAI;IACrB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAA;AAEF;;;GAGG;AACH,SAAgB,SAAS,CAAC,IAAY;IACpC,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAW,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC"}
|
package/dist/GeoTz.d.ts
CHANGED
package/dist/GeoTz.js
CHANGED
|
@@ -5,13 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.geoTz = void 0;
|
|
7
7
|
const tz_lookup_1 = __importDefault(require("@photostructure/tz-lookup"));
|
|
8
|
+
/**
|
|
9
|
+
* @throws if the given latitude and longitude are invalid.
|
|
10
|
+
*/
|
|
8
11
|
function geoTz(lat, lon) {
|
|
9
|
-
|
|
10
|
-
return (0, tz_lookup_1.default)(lat, lon);
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
12
|
+
return (0, tz_lookup_1.default)(lat, lon);
|
|
15
13
|
}
|
|
16
14
|
exports.geoTz = geoTz;
|
|
17
15
|
//# sourceMappingURL=GeoTz.js.map
|
package/dist/GeoTz.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoTz.js","sourceRoot":"","sources":["../src/GeoTz.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAiD;AAGjD,SAAgB,KAAK,CAAC,GAAW,EAAE,GAAW;IAC5C,
|
|
1
|
+
{"version":3,"file":"GeoTz.js","sourceRoot":"","sources":["../src/GeoTz.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAiD;AAGjD;;GAEG;AACH,SAAgB,KAAK,CAAC,GAAW,EAAE,GAAW;IAC5C,OAAO,IAAA,mBAAS,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAC5B,CAAC;AAFD,sBAEC"}
|