Skip to content
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

Support writing metadata to existing files #6

Closed
mesqueeb opened this issue May 7, 2017 · 8 comments
Closed

Support writing metadata to existing files #6

mesqueeb opened this issue May 7, 2017 · 8 comments

Comments

@mesqueeb
Copy link
Contributor

mesqueeb commented May 7, 2017

I was able to read the EXIF data successfully!
I am still a bit confused how to overwrite.

  1. Could you add an example to the docs how to e.g. change the exif orientation of a file?
  2. And if you have some spare time, a second example in the docs with the best/easiest way how to set a photo's date-taken to a different date, that would also be much appreciated.

Thank you very much!

This is what I have for the read part:

fs.readdir(dir, function (err, files) {
    files.forEach(function (file) {
    	exiftool
	    .read(dir+'/'+file)
	    .then((tags /*: Tags */) => {
            console.log(`【${file}】Orientation: ${tags.Orientation}`);
    });
});
@mesqueeb mesqueeb changed the title Question Question overwriting exif data May 7, 2017
@mceachen mceachen changed the title Question overwriting exif data Support writing metadata to existing files May 12, 2017
@mceachen
Copy link
Member

I have not implemented metadata writing.

If you want to have a swing at it, I'd be more than happy to review your PR!

@mceachen
Copy link
Member

This is now supported in version 4.7.1.

@mesqueeb
Copy link
Contributor Author

Wow this is GREAT NEWS!!!!
Now we can use NodeJS to fully read and write metadata of photos!
The world just became a better place!!!

@mesqueeb
Copy link
Contributor Author

@mceachen
I see that in the docs you've added this as example to write metadata:
exiftool.write("path/to/file.jpg", { XPComment: "this is a test comment" });

Can you also provide one example to edit the date taken of a picture?
Cheers!!

@mceachen
Copy link
Member

I updated the docs and added tests, if you look at the latest diffs.

@borisimple
Copy link

This is now supported in version 4.7.1.

What property should I use in order to specify that I want to overwrite the original files?
Can't find it anywhere in docs..

@mceachen
Copy link
Member

What property should I use in order to specify that I want to overwrite the original files? Can't find it anywhere in docs..

https://github.com/photostructure/exiftool-vendored.js/issues?q=is%3Aissue+overwrite_original

Specifically

#64

I've also just added a reference to the .write method: https://photostructure.github.io/exiftool-vendored.js/classes/ExifTool.html#write

@borisimple
Copy link

borisimple commented Jun 13, 2023

@mceachen

Awesome! I managed to use it in the write method instead of the constructor.
Thanks for the quick answer 👌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants