-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete all tags except specified (returns TypeError
)
#178
Comments
You've got several issues going on:
So: import {exiftool} from "exiftool-vendored"
async function run() {
await exiftool.deleteAllTags(
"MY_IMAGE_FILE.jpg",
{ retain: ["Artist", "Copyright","DateTimeOriginal", /* and all the others you've got */] }
)
await exiftool.end()
} There are several new tests so you can see it in action in WriteTask.spec.ts. |
@mceachen, this is awesome! Thank you so much for doing this. I will update my NPM package to download the new version which supports this I really appreciate your help with this 🙏🏻 |
Just FYI, there were a couple hangups with the release: GitHub Actions boxes didn't behave like my local test machines, so there's been some shenanigans in getting this out the door. It'll happen today. |
Released! |
Thank you so much @mceachen! I see the new release in GitHub and NPM. I updated my package successfully to
I updated my code per your recommendation, and it worked perfectly! const exiftool = require("exiftool-vendored").exiftool;
async function run() {
await exiftool.deleteAllTags(
"6--IMG_6715.jpg",
{
retain: [
"exif:Artist",
"exif:Copyright",
"exif:DateTimeOriginal",
"exif:OffsetTimeOriginal",
"iptc:DateCreated",
"iptc:TimeCreated",
"iptc:By-line",
"iptc:By-lineTitle",
"iptc:Credit",
"iptc:Source",
"iptc:CopyrightNotice",
"xmp:DateCreated",
"xmp:Source",
"xmp:Credit",
"xmp:AuthorsPosition",
"xmp:creator",
"xmp:rights",
"xmp:UsageTerms",
"xmp:CreatorContactInfo",
"xmp:WebStatement"
]
}
);
await exiftool.end();
console.log( `SUCCESS!` );
}
run(); I can't thank you enough. I can now push forward with my project. (I made sure to give this repo a star.) Cheers! 🍻 |
QUESTION
How can I use
exiftool-vendored.js
to delete all metadata tags on an image file except those specified?USE CASE
I'm trying to remove all metadata on my file e.g. aperture, shutter speed, ISO, location, etc., but leave all information about copyright and author.
CODE
I have the following JS code:
ERROR
When I execute this code...
...I receive the following error:
SYSTEM
exiftool-vendored
: 25.0.0node
: 20.11.1npm
: 10.2.4MacBook Pro, 16-inch, 2023
Apple M2 Pro
macOS Ventura 13.6.5
Thanks in advance for any assistance you can provide! Really appreciate all the hard work put into this project.
The text was updated successfully, but these errors were encountered: