-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c68acc0
commit 9f850fc
Showing
6 changed files
with
58 additions
and
37 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
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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
const { exec } = require("./util"); | ||
import { readdirSync, unlinkSync } from "fs"; | ||
import { ExifTool } from "exiftool-vendored"; | ||
|
||
// install exiftool | ||
exec("sudo apt install exiftool"); | ||
const exiftool = new ExifTool({ taskTimeoutMillis: 5000 }); | ||
|
||
// strip all metadata to ensure consistency | ||
exec("exiftool -All= -r -overwrite_original ./images"); | ||
exec("exiftool -All= -r -overwrite_original ./print"); | ||
await stripMeta("./images"); | ||
await stripMeta("./print"); | ||
|
||
exiftool.end(); | ||
|
||
// strip all metadata from all images in folder to ensure consistency | ||
async function stripMeta(folder) { | ||
await exiftool.deleteAllTags(folder, ["-recurse", "-overwrite_original"]); | ||
// delete originals | ||
readdirSync(folder) | ||
.filter((filename) => filename.endsWith("_original")) | ||
.map((filename) => `${folder}/${filename}`) | ||
.forEach(unlinkSync); | ||
} |
This file was deleted.
Oops, something went wrong.
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
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