TNThieding/exif

Adding new EXIF tags to an image is not yet supported

Closed this issue ยท 8 comments

This feature would make your library perfect.

I am writing a google photos backup tool and currently am adding a feature to scrape the GPS data from the web interface and add it to the backup files. This is because Google withholds GPS data on files downloaded via their API! I've looked at other EXIF libraries and they are all fiddly and tend to have awkward dependencies.

If you are looking for contributors then I would be interested in implementing this for you.

I've planned on implementing this for a while now, but I've not had the time to get to it. I'd be grateful to receive contributions to the package, so feel free to implement this! It's one of the big remaining features I'd like to offer in the package.

OK, Thanks. I'm starting a side project for a few weeks and will come back to this next.

I agree with Giles. This enhancement would definitely round out the module. I've been reading the code for deleting a tag to try to get an idea of how to add a tag, but its not yet clear to me. If you can give me some insights that would save me time on understanding how the entire segment thing is organized and and what I would have to do to add a tag that would be helpful. (For example, maybe send me some pseudo code on how you would handle the 'add a tag'). Alternatively if either of you can squeeze out the time to start this enhancement that would be great! Thanks. --Daniel

I also would like to add not existing tags to an image. I somehow expected that this is supported already.

I plan on taking some time this week and weekend to experiment with support for adding tags to images. (It's long overdue on my part!)

I just started scanning in my childhood photos and was going to use this library to add the exif datetime so that when uploaded to google they will appear in the approximately correct order. Would love to be able to do that.

I just released v1.0.0 of the package, which finally adds support for adding new EXIF tags to an image and adding an APP1 segment when needed to house EXIF data in an image without pre-existing metadata. (Long overdue, I know!)

@gilesknap, @chbndrhnns , and @DanielGoldfarb -- I hope this enhancement helps your use cases. If you run into any issues, please open new issues with specific details (and example images if possible) so that I can patch it up.

@tobytraylor -- This release will address your use case too. I did extensive manual testing with my scanner (and included similar unit tests to the package) to verify adding timestamps and GPS locations. In fact, the "Usage" page on the documentation contains a "cookbook" with these operations. Hope this helps!

I am closing out this issue. Again, don't hesitate to reach out if there are any wrinkles with this new feature that need to be ironed out. In the meantime, I'll be working through some of the other issue reports now that I have some extra time on my hands. Thank you for the patience, everyone! It took a pretty significant overhaul of the internal byte handling logic and datatypes to facilitate this.

Great. I'll give this a go. Thanks!