ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: alex9000 on August 06, 2020, 11:43:00 AM

Title: problems writing binary data to an existing tag
Post by: alex9000 on August 06, 2020, 11:43:00 AM
Hello,
I've been using exiftool to work with the depth maps in portrait mode images.  Getting the depth maps out is easy and well documented.  Now, I'm working on an application where I modify the depth map and overwrite the original image.

I'm working with iOS portrait mode photos, so the depth map is in the -MPImage2 tag

when I run:
  exiftool -s test-lumen.jpg
I get:
MPImage2                        : (Binary data 36947 bytes, use -b option to extract)

And I can extract the data easily using:
exiftool -b -MPImage2 test-lumen.jpg > depthMap.jpg

I'm having trouble when I try to write a modified depth map back into the tag.

I've been doing:
exiftool '-MPImage2<=new-depth.jpg' test-lumen.jpg 
but I get back
Warning: Tag 'MPImage2' is not defined
Nothing to do.


I feel like I'm missing an option to specify that I'm writing a binary file.  I haven't found an example of writing a binary file into a tag, so I'm just going with the regular 'write tag data from a file' example, just like I would if I were writing a thumbnail image.  I'm not sure why it's saying the tag isn't defined, though.  Do I need to do anything different when it comes to binary data?  Is there some issue with tag write permissions?  I'm attaching the file I'm working with, for reference.  I'm a little lost in the dark here, and I'd appreciate any help. 
Title: Re: problems writing binary data to an existing tag
Post by: StarGeek on August 06, 2020, 11:50:29 AM
If you check the MPF tag page (https://exiftool.org/TagNames/MPF.html), you'll see that exiftool doesn't write any of those tags.
Title: Re: problems writing binary data to an existing tag
Post by: alex9000 on August 06, 2020, 11:53:02 AM
Got it, thanks

Alex