-
Notifications
You must be signed in to change notification settings - Fork 572
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
Minor xmp fixes #1009
base: master
Are you sure you want to change the base?
Minor xmp fixes #1009
Conversation
chkuendig
commented
Dec 1, 2024
- Don't write xmp sidecar for adjusted versions (some metadata like orientation only makes sense when applying to l the original file)
- Some images (screenshots?) have a different 'adjustmentSimpleDataEnc' (plist instead oc compressed JSON) field. This led to a crash
- One comment had the wrong indents
For |
src/icloudpd/base.py
Outdated
@@ -970,7 +970,7 @@ def download_photo_(counter: Counter, photo: PhotoAsset) -> bool: | |||
download.set_utime(download_path, created_date) | |||
logger.info("Downloaded %s", truncated_path) | |||
|
|||
if xmp_sidecar: | |||
if xmp_sidecar and download_size != AssetVersionSize.ADJUSTED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many XMP files we need for one asset downloaded in multiple sizes, e.g. original+alternative or original+live? For requested adjusted
version we download original if adjusted does not exist yet (and there is complex logic for size fallback) - may be we need digging deeper into this ares? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it might make sense to think this through better. Maybe only download the xmp for original? Generally since the XMP is based on the asset record, it should only be created once for a specific foto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only one xmp per asset, then we need some mechanism to ensure it is indeed once for any number of sizes fetched for asset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this change. It's not critical compared to the crash when processing screenshots.
Unfortunately for all fields ending in
The Plist is easy to detect (it has specific header bytes), the other two can only be detected by decoding it (and in theory you could probably have a zlib compressed JSON where all bytes are valid unicode?). |
aff9bb6
to
8f6cd8e
Compare
… the 'adjustmentSimpleDataEnc' field
@AndreyNikiforov I removed the limitation on the |
Great! Add notes to changelog, pls, so it is clear what is new for the next release |