-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- put ExifTool on a diet--extract several interfaces and consts into their own new file - add options support to both read and write tasks - fix typing warnings by exporting Literal/Json - add ImageDataMD5 tests - add MWG read/write round trip tests
- Loading branch information
Showing
14 changed files
with
957 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import * as bc from "batch-cluster" | ||
import { DefaultExiftoolArgs } from "./DefaultExiftoolArgs" | ||
import { DefaultMaxProcs } from "./DefaultMaxProcs" | ||
import { ExifToolOptions } from "./ExifToolOptions" | ||
import { DefaultExifToolPath } from "./FindExiftool" | ||
import { geoTz } from "./GeoTz" | ||
import { isIgnorableWarning } from "./IgnorableError" | ||
import { Omit } from "./Omit" | ||
import { VersionTask } from "./VersionTask" | ||
|
||
/** | ||
* Default values for `ExifToolOptions`, except for `processFactory` (which is | ||
* created by the ExifTool constructor) | ||
*/ | ||
|
||
export const DefaultExifToolOptions: Omit< | ||
ExifToolOptions, | ||
"processFactory" | "ignoreShebang" | ||
> = Object.freeze({ | ||
...new bc.BatchClusterOptions(), | ||
maxProcs: DefaultMaxProcs, | ||
maxTasksPerProcess: 500, | ||
spawnTimeoutMillis: 30000, | ||
// see https://github.com/photostructure/exiftool-vendored.js/issues/34 : | ||
taskTimeoutMillis: 20000, | ||
onIdleIntervalMillis: 2000, | ||
taskRetries: 1, | ||
exiftoolPath: DefaultExifToolPath, | ||
exiftoolArgs: DefaultExiftoolArgs, | ||
exiftoolEnv: {}, | ||
pass: "{ready}", | ||
fail: "{ready}", | ||
exitCommand: "-stay_open\nFalse\n", | ||
versionCommand: new VersionTask().command, | ||
healthCheckIntervalMillis: 30000, | ||
healthCheckCommand: "-ver\n-execute\n", | ||
useMWG: false, | ||
numericTags: [ | ||
"*Duration*", | ||
"GPSAltitude", | ||
"GPSLatitude", | ||
"GPSLongitude", | ||
"GPSPosition", | ||
"Orientation", | ||
], | ||
includeImageDataMD5: false, | ||
defaultVideosToUTC: true, | ||
geoTz: geoTz, | ||
isIgnorableError: isIgnorableWarning, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const DefaultExiftoolArgs = ["-stay_open", "True", "-@", "-"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as _os from "os" | ||
|
||
export const DefaultMaxProcs = Math.max(1, Math.floor(_os.cpus().length / 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.