exiftool-vendored
Advanced tools
Comparing version 3.2.0 to 4.0.0-alpha.0
@@ -25,2 +25,14 @@ ## Versioning | ||
### v4.0.0 | ||
* 💔 All `Tags` fields are now marked as possibly undefined, as there are no | ||
EXIF, IPTC, or other values that are guaranteed to be set. Sorry for the major | ||
break, but the prior signature that promised all values were always set was | ||
strictly wrong. | ||
* ✨ Added support for all downstream | ||
[batch-cluster](https://github.com/mceachen/batch-cluster.js) options in the | ||
ExifTool constructor. | ||
* 📦 Added `ExifTool.pids` (used by a couple new integration tests) | ||
* 📦 Rebuilt `Tags` with additional sample images and looser tag filtering. | ||
### v3.2.0 | ||
@@ -27,0 +39,0 @@ |
import { ExifToolTask } from "./ExifToolTask"; | ||
import { Tags } from "./Tags"; | ||
import { BatchClusterOptions, BatchProcessOptions } from "batch-cluster"; | ||
export { Tags } from "./Tags"; | ||
@@ -17,8 +18,10 @@ export { ExifDate, ExifTime, ExifDateTime, ExifTimeZoneOffset } from "./DateTime"; | ||
readonly taskRetries: number; | ||
readonly batchClusterOpts: Partial<BatchClusterOptions & BatchProcessOptions>; | ||
private readonly batchCluster; | ||
/** | ||
* @param maxProcs The maximum number of ExifTool child processes to spawn | ||
* when load merits | ||
* when load merits. Defaults to 1. | ||
* @param maxTasksPerProcess The maximum number of requests a given ExifTool | ||
* process will service before being retired | ||
* process will service before being retired. Defaults to 250, to balance | ||
* performance with memory usage. | ||
* @param spawnTimeoutMillis Spawning new ExifTool processes must not take | ||
@@ -28,13 +31,18 @@ * longer than `spawnTimeoutMillis` millis before it times out and a new | ||
* seconds to spin up a process, thanks to antivirus shenanigans. This can't | ||
* be set to a value less than 100ms. | ||
* be set to a value less than 100ms. Defaults to 20 seconds, to accomodate | ||
* slow Windows machines. | ||
* @param taskTimeoutMillis If requests to ExifTool take longer than this, | ||
* presume the underlying process is dead and we should restart the task. This | ||
* can't be set to a value less than 10ms, and really should be set to at more | ||
* than a second unless `taskRetries` is sufficiently large. | ||
* than a second unless `taskRetries` is sufficiently large. Defaults to 5 | ||
* seconds. | ||
* @param onIdleIntervalMillis An interval timer is scheduled to do periodic | ||
* maintenance of underlying child processes with this periodicity. | ||
* maintenance of underlying child processes with this periodicity. Defaults | ||
* to 2 seconds. | ||
* @param taskRetries The number of times a task can error or timeout and be | ||
* retried. | ||
* retried. Defaults to 2. | ||
* @param batchClusterOpts Allows for overriding any configuration used by | ||
* `BatchCluster` | ||
*/ | ||
constructor(maxProcs?: number, maxTasksPerProcess?: number, spawnTimeoutMillis?: number, taskTimeoutMillis?: number, onIdleIntervalMillis?: number, taskRetries?: number); | ||
constructor(maxProcs?: number, maxTasksPerProcess?: number, spawnTimeoutMillis?: number, taskTimeoutMillis?: number, onIdleIntervalMillis?: number, taskRetries?: number, batchClusterOpts?: Partial<BatchClusterOptions & BatchProcessOptions>); | ||
/** | ||
@@ -89,8 +97,9 @@ * @return a promise holding the version number of the vendored ExifTool | ||
/** | ||
* Request graceful shut down of any running ExifTool child processes. | ||
* Shut down running ExifTool child processes. No subsequent requests will be | ||
* accepted. | ||
* | ||
* This may need to be called in `after` or `finally` clauses in tests | ||
* or scripts for them to exit cleanly. | ||
* This may need to be called in `after` or `finally` clauses in tests or | ||
* scripts for them to exit cleanly. | ||
*/ | ||
end(): Promise<void>; | ||
end(gracefully?: boolean): Promise<void>; | ||
/** | ||
@@ -101,2 +110,13 @@ * `enqueueTask` is not for normal consumption. External code | ||
enqueueTask<T>(task: ExifToolTask<T>): Promise<T>; | ||
/** | ||
* @return the currently running ExifTool processes. Note that on Windows, | ||
* these are only the process IDs of the directly-spawned ExifTool wrapper, | ||
* and not the actual perl vm. This should only really be relevant for | ||
* integration tests that verify processes are cleaned up properly. | ||
*/ | ||
readonly pids: number[]; | ||
/** | ||
* @return the number of pending (not currently worked on) tasks | ||
*/ | ||
readonly pendingTasks: number; | ||
} | ||
@@ -107,3 +127,5 @@ /** | ||
* set to the number of CPUs on the current system; no more than `maxProcs` | ||
* instances of `exiftool` will be spawned. | ||
* instances of `exiftool` will be spawned. You may want to experiment with | ||
* smaller or larger values for `maxProcs`, depending on CPU and disk speed of | ||
* your system and performance tradeoffs. | ||
* | ||
@@ -110,0 +132,0 @@ * Note that each child process consumes between 10 and 50 MB of RAM. If you |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,5 +37,6 @@ var BinaryExtractionTask_1 = require("./BinaryExtractionTask"); | ||
* @param maxProcs The maximum number of ExifTool child processes to spawn | ||
* when load merits | ||
* when load merits. Defaults to 1. | ||
* @param maxTasksPerProcess The maximum number of requests a given ExifTool | ||
* process will service before being retired | ||
* process will service before being retired. Defaults to 250, to balance | ||
* performance with memory usage. | ||
* @param spawnTimeoutMillis Spawning new ExifTool processes must not take | ||
@@ -37,21 +46,27 @@ * longer than `spawnTimeoutMillis` millis before it times out and a new | ||
* seconds to spin up a process, thanks to antivirus shenanigans. This can't | ||
* be set to a value less than 100ms. | ||
* be set to a value less than 100ms. Defaults to 20 seconds, to accomodate | ||
* slow Windows machines. | ||
* @param taskTimeoutMillis If requests to ExifTool take longer than this, | ||
* presume the underlying process is dead and we should restart the task. This | ||
* can't be set to a value less than 10ms, and really should be set to at more | ||
* than a second unless `taskRetries` is sufficiently large. | ||
* than a second unless `taskRetries` is sufficiently large. Defaults to 5 | ||
* seconds. | ||
* @param onIdleIntervalMillis An interval timer is scheduled to do periodic | ||
* maintenance of underlying child processes with this periodicity. | ||
* maintenance of underlying child processes with this periodicity. Defaults | ||
* to 2 seconds. | ||
* @param taskRetries The number of times a task can error or timeout and be | ||
* retried. | ||
* retried. Defaults to 2. | ||
* @param batchClusterOpts Allows for overriding any configuration used by | ||
* `BatchCluster` | ||
*/ | ||
function ExifTool(maxProcs, maxTasksPerProcess, spawnTimeoutMillis, // it shouldn't take longer than 5 seconds to spin up. 4x that should be quite conservative. | ||
taskTimeoutMillis, // tasks should complete in under 250 ms. 20x that should handle swapped procs. | ||
onIdleIntervalMillis, taskRetries) { | ||
onIdleIntervalMillis, taskRetries, batchClusterOpts) { | ||
if (maxProcs === void 0) { maxProcs = 1; } | ||
if (maxTasksPerProcess === void 0) { maxTasksPerProcess = 100; } | ||
if (maxTasksPerProcess === void 0) { maxTasksPerProcess = 500; } | ||
if (spawnTimeoutMillis === void 0) { spawnTimeoutMillis = 20000; } | ||
if (taskTimeoutMillis === void 0) { taskTimeoutMillis = 5000; } | ||
if (onIdleIntervalMillis === void 0) { onIdleIntervalMillis = 2000; } | ||
if (taskTimeoutMillis === void 0) { taskTimeoutMillis = 1000; } | ||
if (onIdleIntervalMillis === void 0) { onIdleIntervalMillis = 1000; } | ||
if (taskRetries === void 0) { taskRetries = 2; } | ||
if (batchClusterOpts === void 0) { batchClusterOpts = {}; } | ||
this.maxProcs = maxProcs; | ||
@@ -63,13 +78,11 @@ this.maxTasksPerProcess = maxTasksPerProcess; | ||
this.taskRetries = taskRetries; | ||
this.batchCluster = new batch_cluster_1.BatchCluster({ | ||
processFactory: function () { return _child_process.execFile(exiftoolPath, ["-stay_open", "True", "-@", "-"], { | ||
this.batchClusterOpts = batchClusterOpts; | ||
this.batchCluster = new batch_cluster_1.BatchCluster(__assign({ processFactory: function () { return _child_process.execFile(exiftoolPath, ["-stay_open", "True", "-@", "-"], { | ||
stdio: "pipe", | ||
detached: false, | ||
encoding: "utf8", | ||
timeout: 0, | ||
env: { LANG: "C" } | ||
}); }, | ||
versionCommand: new VersionTask_1.VersionTask().command, | ||
pass: "{ready}", | ||
fail: "{ready}", | ||
exitCommand: "\n-stay_open\nFalse\n", | ||
maxProcs: maxProcs, | ||
} // because node types are garbage | ||
); }, versionCommand: new VersionTask_1.VersionTask().command, pass: "{ready}", fail: "{ready}", exitCommand: "\n-stay_open\nFalse\n", maxProcs: maxProcs, | ||
onIdleIntervalMillis: onIdleIntervalMillis, | ||
@@ -79,4 +92,3 @@ spawnTimeoutMillis: spawnTimeoutMillis, | ||
maxTasksPerProcess: maxTasksPerProcess, | ||
taskRetries: taskRetries | ||
}); | ||
taskRetries: taskRetries, retryTasksAfterTimeout: true, maxProcAgeMillis: 10 * 60 * 1000 }, batchClusterOpts)); | ||
} | ||
@@ -144,9 +156,11 @@ /** | ||
/** | ||
* Request graceful shut down of any running ExifTool child processes. | ||
* Shut down running ExifTool child processes. No subsequent requests will be | ||
* accepted. | ||
* | ||
* This may need to be called in `after` or `finally` clauses in tests | ||
* or scripts for them to exit cleanly. | ||
* This may need to be called in `after` or `finally` clauses in tests or | ||
* scripts for them to exit cleanly. | ||
*/ | ||
ExifTool.prototype.end = function () { | ||
return this.batchCluster.end(); | ||
ExifTool.prototype.end = function (gracefully) { | ||
if (gracefully === void 0) { gracefully = true; } | ||
return this.batchCluster.end(gracefully); | ||
}; | ||
@@ -160,2 +174,25 @@ /** | ||
}; | ||
Object.defineProperty(ExifTool.prototype, "pids", { | ||
/** | ||
* @return the currently running ExifTool processes. Note that on Windows, | ||
* these are only the process IDs of the directly-spawned ExifTool wrapper, | ||
* and not the actual perl vm. This should only really be relevant for | ||
* integration tests that verify processes are cleaned up properly. | ||
*/ | ||
get: function () { | ||
return this.batchCluster.pids; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(ExifTool.prototype, "pendingTasks", { | ||
/** | ||
* @return the number of pending (not currently worked on) tasks | ||
*/ | ||
get: function () { | ||
return this.batchCluster.pendingTasks; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return ExifTool; | ||
@@ -168,3 +205,5 @@ }()); | ||
* set to the number of CPUs on the current system; no more than `maxProcs` | ||
* instances of `exiftool` will be spawned. | ||
* instances of `exiftool` will be spawned. You may want to experiment with | ||
* smaller or larger values for `maxProcs`, depending on CPU and disk speed of | ||
* your system and performance tradeoffs. | ||
* | ||
@@ -171,0 +210,0 @@ * Note that each child process consumes between 10 and 50 MB of RAM. If you |
{ | ||
"name": "exiftool-vendored", | ||
"version": "3.2.0", | ||
"version": "4.0.0-alpha.0", | ||
"description": "Efficient, cross-platform access to ExifTool", | ||
@@ -50,10 +50,10 @@ "main": "./dist/ExifTool.js", | ||
"devDependencies": { | ||
"@types/chai": "^3.4.35", | ||
"@types/chai": "^3.5.2", | ||
"@types/chai-as-promised": "^0.0.30", | ||
"@types/mocha": "^2.2.40", | ||
"@types/node": "^7.0.11", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^7.0.22", | ||
"@types/pify": "^0.0.28", | ||
"@types/rimraf": "^0.0.28", | ||
"@types/semver": "^5.3.31", | ||
"@types/tmp": "^0.0.32", | ||
"@types/tmp": "^0.0.33", | ||
"@types/xmldom": "^0.1.29", | ||
@@ -64,17 +64,17 @@ "chai": "^3.5.0", | ||
"globule": "^1.1.0", | ||
"longjohn": "^0.2.12", | ||
"mocha": "^3.2.0", | ||
"np": "^2.13.1", | ||
"mocha": "^3.4.2", | ||
"np": "^2.15.0", | ||
"npm-run-all": "^4.0.2", | ||
"pify": "^2.3.0", | ||
"pify": "^3.0.0", | ||
"progress": "^2.0.0", | ||
"rimraf": "^2.6.1", | ||
"semver": "^5.3.0", | ||
"source-map-support": "^0.4.14", | ||
"source-map-support": "^0.4.15", | ||
"tar-fs": "^1.15.2", | ||
"tmp": "^0.0.31", | ||
"tslint": "^4.5.1", | ||
"tslint-config-standard": "^4.0.0", | ||
"tslint-eslint-rules": "^3.5.1", | ||
"typescript": "^2.3.1", | ||
"typescript-formatter": "^5.1.2", | ||
"tslint": "^5.3.2", | ||
"tslint-config-standard": "^5.0.2", | ||
"tslint-eslint-rules": "^4.1.1", | ||
"typescript": "^2.3.4", | ||
"typescript-formatter": "^5.2.0", | ||
"xmldom": "^0.1.27", | ||
@@ -84,3 +84,3 @@ "xpath": "^0.0.24" | ||
"dependencies": { | ||
"batch-cluster": "^1.2.0" | ||
"batch-cluster": "1.4.1" | ||
}, | ||
@@ -87,0 +87,0 @@ "optionalDependencies": { |
@@ -29,3 +29,3 @@ # exiftool-vendored | ||
1. **Robust test suite**, performed with Node v4, v6 and v7 on [Linux, | ||
1. **Robust test suite**, performed with Node v4, v6, v7, and v8 on [Linux, | ||
Mac](https://travis-ci.org/mceachen/exiftool-vendored.js), & | ||
@@ -32,0 +32,0 @@ [Windows](https://ci.appveyor.com/project/mceachen/exiftool-vendored/branch/master). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
278744
5756
1
+ Addedbatch-cluster@1.4.1(transitive)
- Removedbatch-cluster@1.11.0(transitive)
Updatedbatch-cluster@1.4.1