RhetTbull/osxphotos

Edited iPhone screenshots are not grouped properly

Opened this issue · 3 comments

When importing an iPhone screenshot consisting of IMG_1234.PNG, IMG_1234.AAE, and IMG_E1234.jpeg, osxphotos decides that the AAE file is not an Apple Photos file and ungroups the files. The root cause is that the screenshot editor sets the AAE file's "adjustmentFormatIdentifier" to "ScreenshotServices".

Here is an example: IMG_6743.zip

Thanks for the test data. Will work to get this incorporated when I have time. This should be an easy fix. The check for import is done in a single function that can be modified:

def is_apple_photos_aae_file(filepath: str | os.PathLike) -> bool:
"""Return True if filepath is an AAE file containing Apple Photos adjustments; returns False is file contains adjustments for an external editor"""
if plist := load_aae_file(filepath):
if plist.get("adjustmentFormatIdentifier") == "com.apple.photo":
return True
return False