How to adjust MP Image values on resize?

Started by orionr, November 03, 2017, 02:04:23 PM

Previous topic - Next topic

orionr

Hi Phil,

exiftool is a great piece of software! Very well done. I'm trying to extract depth maps from iOS 11 Portrait Mode photos and it works great on the original image with exiftool a.jpg -b -MPImage2 > a_depth.jpg. However, I have an image that was resized and all of the EXIF headers copied over. Unfortunately when I try to extract depth from this with exiftool a_resized.jpg -b -MPImage2 I get the error

Warning: Error reading MPImage2 from file - a_resized.jpg

I've confirmed the field is the same length as the original, but maybe it's been corrupted in some way? Does resizing typically affect these binary EXIF entries? Any thoughts on how to debug given that I can't extract with exiftool would also be greatly appreciated.

I've attached the resized image just in case you have some ideas. Unfortunately the original was too big to attach. Thank you again for creating a great tool!

Orion

orionr

After more investigation, it looks like the EXIF headers are copied over, but the MP Image 2 data (after inspecting hex) might no longer be there... that would explain it. Phil, any pointers or thoughts on how to copy (or preserve) this on resize? This is in the technical weeds, I know. :) Thanks again.

Phil Harvey

I know of no software that will preserve the MPImage during a resize.  One would expect there would be something out there, but it would be specialized to handle this sort of thing.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).