-
Notifications
You must be signed in to change notification settings - Fork 573
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
Add Export of metadata via XMP Sidecar #984
Add Export of metadata via XMP Sidecar #984
Conversation
6d6473b
to
b01db33
Compare
Thanks for taking initiative. Appreciate writing tests for new features. Can you implement all these features without external dependency on exiftool, pls? |
I understand the preference to keep this working without any external dependencies. Unfortunately for XMP handling I couldn't find a single library that wouldn't need external dependencies. I specifically looked at:
I couldn't find a single pure python library and I don't really have the bandwith to implement a fairly complex standard from scratch just for this. If any of the other 2 libraries are okay, I'm happy to re-implement the PR. Or maybe there's a better way I'm not aware of? Like many I use docker so external depencendies aren't really an issue for me. |
is it reasonable too generated xmp file just from metadata received from Apple (without exif at all)? xmp will have to bed generated with the code i assume |
Thats what I'm doing, I use exiftool just to write the sidecar file. I'll check if its feasible to just write the XML by hand. As long as we stick to the +/- 10 fields, its cumbersome but probably doable by just generating the xml once with exiftool and then write code to replicate it in pure python. |
what happens when metadata is updated in icloud? should local xmp be synchronized? what if local changed as well? |
I currently assumed this to be mostly an archival function, so the iCloud data would overwrite local data. Thinking more about this, I'd suggest we check the XMLToolkit tag to make sure the last edit was by icloudpd. It seems to be a tag thats changed if edited by another software. I'll add this with the update to remove external dependencies. |
3662351
to
f6c4888
Compare
I pushed an update that removes the dependency on exitfool and also checks if an xmp file exists before overwriting it (it only overwrites if the file is empty or was generated by icloudpd in the first place) note: I updated the lint python version to 3.9 so I can use ElementTree.indent |
f6c4888
to
7f9af56
Compare
Does that mean we have to drop support for 3.8? |
Yes. If thats an issue i'd suggest to remove that call and output unformatted xml instead. |
Thanks! I think maintaining 3.8 compatibility is higher value than pretty printed small xml file (which is not supposed to be viewed by humans) |
7f9af56
to
e7ded3c
Compare
Done. PS: I also found a bug in the orientation field (it did not reflect possible adjustments). This should be corrected now. |
c75f162
to
4eefa8f
Compare
fda998d
into
icloud-photos-downloader:master
There have been multiple requests over time ( #448, #102, #789, probably more) to export some of the metadata that can be changed in Photos. This PR tries to address as many of these as possible but focused on the most common ones:
I tested this on my 50'000+ images library and it processed all of them. If the Exif Tags are supported by Immich they also match. (this helped a ton to sort the images in the correct order and add missing location tags to pictures taken without embedded location info - e.g. from DSLR etc)
PS: This also would replace/close #915 I guess.