exiftool-vendored
Advanced tools
Comparing version 2.17.0 to 3.0.0
{ | ||
"name": "exiftool-vendored", | ||
"version": "2.17.0", | ||
"version": "3.0.0", | ||
"description": "Efficient, cross-platform access to ExifTool", | ||
@@ -12,2 +12,3 @@ "main": "./dist/exiftool.js", | ||
"compile": "tsc", | ||
"tscw": "rimraf dist & tsc -w", | ||
"preupdate": "run-s clean lint compile", | ||
@@ -18,3 +19,3 @@ "update": "node dist/update/update.js", | ||
"pretest": "tsc", | ||
"test": "mocha --timeout 10000 dist/**/*.spec.js", | ||
"test": "mocha", | ||
"cleantest": "run-s clean lint fmt pdm test", | ||
@@ -25,24 +26,2 @@ "preversion": "run-s lint pdm", | ||
}, | ||
"files": [ | ||
"dist/binary_extraction_task.d.ts", | ||
"dist/binary_extraction_task.js", | ||
"dist/datetime.d.ts", | ||
"dist/datetime.js", | ||
"dist/deferred.d.ts", | ||
"dist/deferred.js", | ||
"dist/delay.d.ts", | ||
"dist/delay.js", | ||
"dist/exiftool_process.d.ts", | ||
"dist/exiftool_process.js", | ||
"dist/exiftool.d.ts", | ||
"dist/exiftool.js", | ||
"dist/tags_task.d.ts", | ||
"dist/tags_task.js", | ||
"dist/tags.d.ts", | ||
"dist/tags.js", | ||
"dist/task.d.ts", | ||
"dist/task.js", | ||
"dist/version_task.d.ts", | ||
"dist/version_task.js" | ||
], | ||
"publishConfig": { | ||
@@ -79,9 +58,9 @@ "access": "public" | ||
"linux": [ | ||
"exiftool-vendored.pl@10.50.0" | ||
"exiftool-vendored.pl@10.51.0" | ||
], | ||
"darwin": [ | ||
"exiftool-vendored.pl@10.50.0" | ||
"exiftool-vendored.pl@10.51.0" | ||
], | ||
"win32": [ | ||
"exiftool-vendored.exe@10.50.0" | ||
"exiftool-vendored.exe@10.51.0" | ||
] | ||
@@ -93,3 +72,2 @@ } | ||
"@types/chai-as-promised": "^0.0.30", | ||
"@types/debug": "^0.0.29", | ||
"@types/jsdom": "^2.0.30", | ||
@@ -120,3 +98,3 @@ "@types/mocha": "^2.2.40", | ||
"tslint-eslint-rules": "^3.5.1", | ||
"typescript": "^2.2.1", | ||
"typescript": "^2.3.1", | ||
"typescript-formatter": "^5.1.2", | ||
@@ -127,5 +105,5 @@ "xmldom": "^0.1.27", | ||
"dependencies": { | ||
"debug": "^2.6.3", | ||
"batch-cluster": "^1.0.0", | ||
"platform-dependent-modules": "^0.0.14" | ||
} | ||
} |
301
README.md
# exiftool-vendored | ||
**Blazing-fast, cross-platform [Node](https://nodejs.org/) access to [ExifTool](http://www.sno.phy.queensu.ca/~phil/exiftool/).** | ||
**Fast, cross-platform [Node.js](https://nodejs.org/) access to [ExifTool](http://www.sno.phy.queensu.ca/~phil/exiftool/).** | ||
@@ -11,10 +11,9 @@ [](https://badge.fury.io/js/exiftool-vendored) | ||
1. **High performance** via [`-stay_open`](#stay_open) and [multithreading](#parallelism). | ||
**[7-300x faster performance](#performance)** than competing packages (depending on platform)! | ||
1. **Best-of-class cross-platform performance**. | ||
1. Support for [Mac, Linux](https://travis-ci.org/mceachen/exiftool-vendored.js), and [Windows](https://ci.appveyor.com/project/mceachen/exiftool-vendored/branch/master). | ||
*Depending on platform, expect [8-300x faster performance ]((#performance)) than other packages.* | ||
1. Proper extraction of | ||
- **dates** with [correct timezone offset encoding, when available](#dates)) | ||
- **latitudes & longitudes** as floats (where negative values indicate W or S of the meridian) | ||
- **latitudes & longitudes** as floats (where negative values indicate west or south of the meridian) | ||
- **embedded images**, both `Thumbnail` and `Preview` (if they exist) | ||
@@ -25,4 +24,4 @@ | ||
1. **Auditable ExifTool source code** (the "vendored" code is | ||
[verifiable](http://owl.phy.queensu.ca/~phil/exiftool/checksums.txt)) | ||
1. **Auditable ExifTool source code** (the vendored code is | ||
[checksum verified](http://owl.phy.queensu.ca/~phil/exiftool/checksums.txt)) | ||
@@ -42,3 +41,3 @@ 1. **Automated updates** to ExifTool ([as new versions come out | ||
The vendored version of ExifTool relevant for your platform will be installed | ||
Note that `exiftool-vendored` provides an installation of ExifTool relevant for your platform | ||
via | ||
@@ -78,52 +77,2 @@ [platform-dependent-modules](https://www.npmjs.com/package/platform-dependent-modules). | ||
## Performance | ||
With the `npm run mktags` target, > 3000 sample images, and `maxProcs` set to 4, | ||
reading tags on my laptop takes ~6 ms per image: | ||
```sh | ||
Read 2236 unique tags from 3011 files. | ||
Parsing took 16191ms (5.4ms / file) # win32, core i7, maxProcs 4 | ||
Parsing took 27141ms (9.0ms / file) # ubuntu, core i3, maxProcs 1 | ||
Parsing took 12545ms (4.2ms / file) # ubuntu, core i3, maxProcs 4 | ||
``` | ||
For reference, using the `exiftool` npm package (which doesn't work on Windows) | ||
took 85 seconds (almost 7x the time): | ||
```sh | ||
Reading 3011 files... | ||
Parsing took 85654ms (28.4ms / file) # ubuntu, core i3 | ||
``` | ||
This package is so much faster due to `ExifTool` stay_open and support for > 1 | ||
child processes. | ||
### stay_open | ||
Starting the perl version of ExifTool is expensive, and is *especially* | ||
expensive on the Windows version of ExifTool. | ||
On Windows, a distribution of Perl and the ~1000 files that make up ExifTool are | ||
extracted into a temporary directory for **every invocation**. Windows virus | ||
scanners that wedge reads on these files until they've been determined to be | ||
safe make this approach even more costly. | ||
Using `-stay_open` we can reuse a single instance of ExifTool across all | ||
requests, which drops response latency dramatically. | ||
### Parallelism | ||
The `exiftool` singleton is configured with a `maxProcs` of 1; no more than 1 | ||
child process of ExifTool will be spawned, even if there are many read requests | ||
outstanding. | ||
If you want higher throughput, instantiate your own singleton reference of | ||
`ExifTool` with a higher maxProcs. Note that exceeding your cpu count won't | ||
increase throughput, and that each child process consumes between 10 and 50 MB | ||
of RAM. | ||
You may want to call `.end()` on your singleton reference when your script | ||
terminates. This gracefully shuts down all child processes. | ||
## Dates | ||
@@ -160,216 +109,64 @@ | ||
The `tags.ts` file is autogenerated by parsing through images of more than 3,000 | ||
different camera makes and models taken from the ExifTool site. It groups tags, | ||
their type, frequency, and example values such that your IDE can autocomplete. | ||
The [tags.ts](blob/master/src/tags.ts) file is autogenerated by parsing through | ||
images of more than 3,000 different camera makes and models taken from the | ||
ExifTool site. It groups tags, their type, popularity, and example values such | ||
that your IDE can autocomplete. | ||
Note that tag existence and types is **not guaranteed**. If parsing fails (for, | ||
example, and datetime string), the raw string will be returned. Consuming code | ||
should verify both existence and type as reasonable for safety. | ||
Note that if parsing fails (for, example, a datetime string), the raw string | ||
will be returned. Consuming code should verify both existence and type as | ||
reasonable for safety. | ||
## Logging | ||
## Performance | ||
[debug](https://www.npmjs.com/package/debug) is used with the | ||
`exiftool-vendored` prefix. | ||
As a rigorous benchmark, the `npm run mktags` target reads all tags found in a | ||
batch of sample images and parses the results. | ||
## Versioning | ||
Using `exiftool-vendored`: | ||
I wanted to include the ExifTool's version number explicitly in the version | ||
number, but npm requires strict compliance with SemVer. Given that ExifTool | ||
sometimes includes patch releases, there aren't always enough spots to encode an | ||
API version *and* the ExifTool version. | ||
```sh | ||
Read 2236 unique tags from 3011 files. | ||
Parsing took 16191ms (5.4ms / file) # win32, core i7, maxProcs 4 | ||
Parsing took 27141ms (9.0ms / file) # ubuntu, core i3, maxProcs 1 | ||
Parsing took 12545ms (4.2ms / file) # ubuntu, core i3, maxProcs 4 | ||
``` | ||
Given those constraints, version numbers follow standard SemVer, with the | ||
following scheme: | ||
Using the `exiftool` npm package takes 7x longer: | ||
```sh | ||
API.UPDATE.PATCH | ||
Reading 3011 files... | ||
Parsing took 85654ms (28.4ms / file) # ubuntu, core i3 | ||
``` | ||
### `API` is incremented for | ||
* 💔 Non-backward-compatible API changes | ||
* 🌲 New releases of ExifTool that have externally visible changes | ||
### Batch mode | ||
### `UPDATE` is incremented for | ||
Starting the perl version of ExifTool is expensive, and is *especially* | ||
expensive on the Windows version of ExifTool. | ||
* 🌱 New releases of ExifTool with no externally visible changes | ||
* 🐛 Bugfixes | ||
* ✨ Backward-compatible features | ||
On Windows, for **every invocation**, exiftool *installs a distribution of Perl | ||
**and** extracts the ~1000 files that make up ExifTool*, and then runs the | ||
script. Windows virus scanners prevent reads on these files while they are | ||
scanned, which makes this approach even more costly. | ||
### `PATCH` is incremented for | ||
Using ExifTool's `-stay_open` batch mode, we can reuse a single instance of | ||
ExifTool across many requests, dropping response latency dramatically and | ||
reducing system load. | ||
* 📦 Minor packaging changes | ||
* 🐞 Minor bugfixes | ||
### Parallelism | ||
## Changelog | ||
The `exiftool` singleton is configured with a `maxProcs` set to the number of | ||
CPUs on the current system; no more than `maxProcs` instances of `exiftool` will | ||
be spawned. | ||
Note that each child process consumes between 10 and 50 MB of RAM. If you have | ||
limited system resources you may want to use a smaller `maxProcs` value. | ||
### v2.17 | ||
## Logging | ||
* 🐛 Rounded milliseconds were not set by `ExifDateTime.toDate()` when timezone | ||
was not available. Breaking tests were added. | ||
[debuglog](https://nodejs.org/api/util.html#util_util_debuglog_section) is used | ||
with the `exiftool` prefix. To enable logging, set the environment flag | ||
`NODE_DEBUG=exiftool`. | ||
### v2.16.1 | ||
## Changelog | ||
* 📦 Exposed datetime parsing via static methods on `ExifDateTime`, `ExifDate`, and `ExifTime`. | ||
### v2.16.0 | ||
* ✨ Some newer smartphones (like the Google Pixel) render timestamps with | ||
microsecond precision, which is now supported. | ||
### v2.15.0 | ||
* ✨ Added example movies to the sample image corpus used to build the tag | ||
definitions. | ||
### v2.14.0 | ||
* ✨ Added `taskTimeoutMillis`, which will cause the promise to be rejected if | ||
exiftool takes longer than this value to parse the file. Note that this | ||
timeout only starts "ticking" when the task is enqueued to an idle ExifTool | ||
process. | ||
* ✨ Pump the `onIdle` method every `onIdleIntervalMillis` (defaults to every 10 | ||
seconds) to ensure all requested tasks are serviced. | ||
* ✨ If `ECONN` or `ECONNRESET` is raised from the child process (which seems to | ||
happen for roughly 1% of requests), the current task is re-enqueued and the | ||
current exiftool process is recycled. | ||
* ✨ Rebuilt `Tags` definitions using more (6,412!) sample image files | ||
(via `npm run mktags ~/sample-images`), including many RAW image types | ||
(like `.ORF`, `.CR2`, and `.NEF`). | ||
### v2.13.0 | ||
* ✨ Added `maxReuses` before exiftool processes are recycled | ||
* 🌱 ExifTool upgraded to v10.50 | ||
### v2.12.0 | ||
* 🐛 Fixed [`gps.toDate is not a function`](https://github.com/mceachen/exiftool-vendored.js/issues/3) | ||
### v2.11.0 | ||
* 🌱 ExifTool upgraded to v10.47 | ||
* ✨ Added call to `.kill()` on `.end()` in case the stdin command was missed by ExifTool | ||
### v2.10.0 | ||
* ✨ Added support for Node 4. TypeScript builds under es5 mode. | ||
### v2.9.0 | ||
* 🌱 ExifTool upgraded to v10.46 | ||
### v2.8.0 | ||
* 🌱 ExifTool upgraded to v10.44 | ||
* 📦 Upgraded to TypeScript 2.2 | ||
* 🐞 `update/io.ts` error message didn't handle null statuscodes properly | ||
* 🐞 `update/mktags.ts` had a counting bug exposed by TS 2.2 | ||
### v2.7.0 | ||
* ✨ More robust error handling for child processes (previously there was no | ||
`.on("error")` added to the process itself, only on `stderr` of the child | ||
process). | ||
### v2.6.0 | ||
* 🌱 ExifTool upgraded to v10.41 | ||
* ✨ `Orientation` is [rendered as a string by | ||
ExifTool](http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#n---printConv), | ||
which was surprising (to me, at least). By exposing optional args in | ||
`ExifTool.read`, the caller can choose how ExifTool renders tag values. | ||
### v2.5.0 | ||
* 🐞 `LANG` and `LC_` environment variables were passed through to exiftool (and | ||
subsequently, perl). These are now explicitly unset when exec'ing ExifTool, | ||
both to ensure tag names aren't internationalized, and to prevent perl errors | ||
from bubbling up to the caller due to missing locales. | ||
### v2.4.0 | ||
* ✨ `extractBinaryTag` exposed because there are a **lot** of binary tags (and | ||
they aren't all embedded images) | ||
* 🐞 `JpgFromRaw` was missing in `Tag` (no raw images were in the example corpus!) | ||
### v2.3.0 | ||
* ✨ `extractJpgFromRaw` implemented to pull out EXIF-embedded images from RAW formats | ||
### v2.2.0 | ||
* 🌱 ExifTool upgraded to v10.40 | ||
### v2.1.1 | ||
* ✨ `extractThumbnail` and `extractPreview` implemented to pull out EXIF-embedded images | ||
* 📦 Rebuilt package.json.files section | ||
### v2.0.1 | ||
* 💔 Switched from home-grown `logger` to [debug](https://www.npmjs.com/package/debug) | ||
### v1.5.3 | ||
* 📦 Switch back to `platform-dependent-modules`. | ||
[npm warnings](http://stackoverflow.com/questions/15176082/npm-package-json-os-specific-dependency) | ||
aren't awesome. | ||
* 📦 Don't include tests or updater in the published package | ||
### v1.5.0 | ||
* 🌱 ExifTool upgraded to v10.38 | ||
* 📦 Use `npm`'s os-specific optionalDependencies rather than `platform-dependent-modules`. | ||
### v1.4.1 | ||
* 🐛 Several imports (like `process`) name-collided on the globals imported by Electron | ||
### v1.4.0 | ||
* 🌱 ExifTool upgraded to v10.37 | ||
### v1.3.0 | ||
* 🌱 ExifTool upgraded to v10.36 | ||
* ✨ `Tag.Error` exposed for unsupported file types. | ||
### v1.2.0 | ||
* 🐛 It was too easy to miss calling `ExifTool.end()`, which left child ExifTool | ||
processes running. The constructor to ExifTool now adds a shutdown hook to | ||
send all child processes a shutdown signal. | ||
### v1.1.0 | ||
* ✨ Added `toString()` for all date/time types | ||
### v1.0.0 | ||
* ✨ Added typings reference in the package.json | ||
* 🌱 Upgraded vendored exiftool to 10.33 | ||
### v0.4.0 | ||
* 📦 Fixed packaging (maintain jsdocs in .d.ts and added typings reference) | ||
* 📦 Using [np](https://www.npmjs.com/package/np) for packaging | ||
### v0.3.0 | ||
* ✨ Multithreading support with the `maxProcs` ctor param | ||
* ✨ Added tests for reading images with truncated or missing EXIF headers | ||
* ✨ Added tests for timezone offset extraction and rendering | ||
* ✨ Subsecond resolution from the Google Pixel has 8 significant digits(!!), | ||
added support for that. | ||
### v0.2.0 | ||
* ✨ More rigorous TimeZone extraction from assets, and added the | ||
`ExifTimeZoneOffset` to handle the `TimeZone` composite tag | ||
* ✨ Added support for millisecond timestamps | ||
### v0.1.1 | ||
🌱✨ Initial Release. Packages ExifTool v10.31. | ||
See [CHANGELOG.md](blob/master/CHANGELOG.md). |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
31
149744
18
3816
168
2
+ Addedbatch-cluster@^1.0.0
+ Addedbatch-cluster@1.11.0(transitive)
- Removeddebug@^2.6.3
- Removeddebug@2.6.9(transitive)
- Removedms@2.0.0(transitive)