-
Notifications
You must be signed in to change notification settings - Fork 11
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 reference to HDR gainmap to the GCamera XMP tag if present in the source image #15
Comments
I've tried hand-crafting one JPG file from live photo (sorry, taken at home, won't attach my GPS coords here :-) ), but the results are unfortunately mixed:
I guess it does have something to do with the multipicture JPEG format, I'll need to look into (de/re)muxing it... Because the vanilla MotionPhoto produced by the script is not detected as HDR in GPhotos, but it is detected as Rich Contrast in iOS... but does not render in HDR either. So just adding bytes to the end of the file breaks the HDR format. |
changing MPF header has no impact - even when it is obviously wrong, everything still works without video... But as soon as video is added, it breaks. Trying with ultrahdr_app from libultrahdr, I get error when decoding iPhone ISO HDR JPGs: |
So the urn:iso:std:iso:ts:21496:-1 structure is completely different between android and ios... it appears that ios is 8 bytes longer than what Android expects for 1-channel record and the fields do not seem to map in sensible way to each other. Looking at the data, it seems that iOS stores RGB 3-channel channel metadata in there, but that does not map into the libultrahdr fields either. I'll try to document it and raise it as libultrahdr issue... |
Ok, so... After the latest updates to libultrahdr (it was error in the library), it's possible: Probably the first JPG HDR Motion Photo created from JPG HDR Live Photo, enjoy. I had to strip all tags from the files in order for the ultrahdr_app to work correctly, so no metadata apart from HDR in the MotionPhoto for now - but yay! I'll need to work on this quite a bit to make it actually work in the script, though - the gainmap needs to be demuxed, metadata updated to google format and remuxed back into JPG, then the video footer needs to be added. |
unfortunately when GPhoto saves this MotionPhoto back to iOS camera roll, it loses everything and turns into pure JPG with no metadata and thus no HDR. But within GPhotos it works well. |
When we mux iPhone 15 pro iOS18.1 JPG (e.g. containing urn:iso:std:iso:ts:21496:-1 gainmap metadata) into MotionPhoto, GPhoto does not recognize the resulting photo as HDR, although to the best of my understanding it should. Try to parse the gainmap position in the source file and reference it in XMP Item:Semantic="GainMap" record.
The text was updated successfully, but these errors were encountered: