Closed finestream closed 6 months ago
Interesting -- I was able to reproduce this. It seems that importing live photos does indeed cause Photos to associate the pair. The error has to do with the fact that when Photos does this it doesn't return the UUID for the newly imported live component (presumably because it didn't create a new asset, just matched it to the existing asset.) I confirmed the order of import is not important -- it happens whether you import the .HEIC or the .mov first and it doesn't matter if you've imported something else in between the two components.
Interestingly this does not work for RAW+JPEG pairs.
I will look at how to handle this in import. The good news is the import still works correctly despite the error but the errors should not really be reported as they're not actually errors. The code should look for live pairs in the current folder and import those together.
These can be imported at once like this:
>>> from photoscript import PhotosLibrary
>>> photoslib = PhotosLibrary()
>>> results = photoslib.import_photos(["/users/user/Desktop/export/IMG_4331.HEIC", "/users/user/Desktop/export/IMG_4331.mov"],skip_duplicate_check=True)
>>> results
[<photoscript.Photo object at 0x102355fd0>]
>>> photo = results[0]
>>> photo.uuid
'6457941A-0CFE-4B4B-B19D-F8C37E932051'
>>>
Interestingly if I create a random video the same name as the HEIC, Photos does not import this as the live component. Photos is matching the live + HEIC components somehow ....time, metadata, etc. I need to figure out how it's doing this and only import as a pair when they match.
The image component has this metadata:
[MakerNotes] Live Photo Video Index : 1111498752
The live video has this:
[QuickTime] Live Photo Auto : 1
[QuickTime] Live Photo Vitality Score : 1
[QuickTime] Live Photo Vitality Scoring Version: 4
So it might be possible to check both images to see if they are "live" before import. Will need to do some testing to see what triggers the association in Photos.
Here I found more infos on how the files are tagged: https://stackoverflow.com/questions/32508375/apple-live-photo-file-format - hope it helps
Great! That's perfect. For the images, I already have code that can read the metadata (cgmetadata) but will need to write code to read the Quicktime metadata. (exiftool can do this but I don't want to make it a dependency for import).
Before submitting a bug report, please ensure you are running the most recent version of osxphotos and that the bug is reproducible on the latest version
Describe the bug The documentation of the import command mentions " - Live photos and RAW+JPEG pairs are imported as separate files, not as a single asset." This is not correct Live Photos are (at least on MacOS 14.2.1) matched on the Mac application and imported as a single asset.
To Reproduce Steps to reproduce the behavior:
Step 1 export
osxphotos export \ \
--live \ --sidecar JSON \ --library