osxphotos icon indicating copy to clipboard operation
osxphotos copied to clipboard

Export modifications as well?

Open mccarverone opened this issue 4 years ago • 7 comments

Hello thank you very much for your awesome work on this project.

I am trying to understand the best possible way to export my library from Photos while keeping 100% information pertaining to the media files. My objective is to have the original media file exported with all the relevant details in a separate sidecar file.

One missing piece of the puzzle would be the possibility to export the basic information about image CROP editing, which are provided as fields at least in XMP metadata format.

https://www.exiv2.org/tags-xmp-crs.html

What do you think? Is this information easily discoverable from Photos db?

Thanks, Riccardo

mccarverone avatar May 24 '20 13:05 mccarverone

I've not been able to reverse engineer the photo adjustments. I've not spent considerable time on this but have looked at the database and tried to understand how adjustments were being stored--unfortunately the information on adjustments is not straight forward.

osxphotos does export the modified jpeg image but it is not able to decode the adjustment history (for example, crop, filter, adjust lighting, etc). If I can eventually figure out how decode this information I'll certainly add an interface to it.

RhetTbull avatar May 24 '20 15:05 RhetTbull

I sort of expected this. Thanks for your reply. Kind regards

mccarverone avatar May 24 '20 17:05 mccarverone

Could re-open this now based on the progress in https://github.com/RhetTbull/osxphotos/issues/215#issuecomment-698663130. Would also keep that issue focused on RAW conversion and could further discuss how to handle adjustment data here.

neilpa avatar Sep 28 '20 16:09 neilpa

@mccarverone Thanks to some amazing sleuthing by @neilpa , I'll now be able to extract the adjustments/edits from Photos. I'll add the ability to extract basic information about the adjustments. For crop info, what would the use case be for putting these in the XMP sidecar? I assume you'd want the crop information in XMP tags for the original file (because the edited file is already cropped)?

RhetTbull avatar Feb 18 '21 06:02 RhetTbull

Crop data looks like this:

{'adjustments': [{'enabled': True,
                  'formatVersion': 1,
                  'identifier': 'RKRawDecodeOperation',
                  'settings': {'DGOperationClassName': 'DGRawDecodeOperation',
                               'DGOperationDisplayName': 'RAW Fine Tuning',
                               'DGOperationIdentifier': 'RKRawDecodeOperation',
                               'enabled': True,
                               'inputKeys': {'inputMethodVersion': '8'}}},
                 {'enabled': True,
                  'formatVersion': 1,
                  'identifier': 'Crop',
                  'settings': {'constraintHeight': 0,
                               'constraintWidth': 0,
                               'height': 2992,
                               'straightenAngle': 0,
                               'width': 3584,
                               'xOrigin': 448,
                               'yOrigin': 0}}],
 'formatVersion': 1,
 'metadata': {'masterHeight': 3024,
              'masterWidth': 4032,
              'orientation': 6,
              'pipelineVersion': 'OSX.4'},
 'versionInfo': {'appVersion': '311.0.130',
                 'buildNumber': '20B28',
                 'platform': 'OSX',
                 'schemaRevision': 1}}

RhetTbull avatar Feb 18 '21 06:02 RhetTbull

That is exactly right. Use case is to find the same adjustments when importing the untouched original photo and its XMP in a different software. I hope that these metadata are sufficiently widespread to allow this. Thanks for your efforts.

mccarverone avatar Feb 18 '21 12:02 mccarverone

I think I might be able to get the crop data into the XMP but I'm not hopeful on much of the edits beyond that. All the other edits would be filters or other changes that wouldn't translate from Photos to another program.

RhetTbull avatar Feb 18 '21 13:02 RhetTbull