ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: volker on March 22, 2018, 12:00:44 PM

Title: Binary data not extracted for some tags
Post by: volker on March 22, 2018, 12:00:44 PM
Hi Phil,

I have a problem extracting some binary data, e.g. DustRemovalData from Canon files. Using

exiftool -json -a -e -G1:4 -n -s -struct CanonEOS500D.jpg

the output contains

"Canon:DustRemovalData": "(Binary data 1024 bytes, use -b option to extract)"

But, if I add the -b option to the command, the output does not contain this tag at all. While trying to understand the reason for this, I found the code starting at line 2135 in exiftool (version 10.87) seems to cause this:

if (defined $binaryOutput and not $binaryOutput and $$et{TAG_INFO}{$tag}{Protected}) {

Is this the expected behavior, or is it a bug? If it is expected, how can I identify the tags which will be suppressed?

Thanks,
Volker
Title: Re: Binary data not extracted for some tags
Post by: Phil Harvey on March 22, 2018, 12:37:31 PM
Hi Volker,

Very good sleuthing!

In general, this is done to prevent large binary data blocks from being copied unless they are specified explicitly.  I can't recall now why this was done for the -X, -j and -php options, but it was certainly intentional.

This will affect any tag with the "Binary" and "Unsafe" flags set in the -listx -f output.  Unsafe tags are denoted in the tag name documentation with a "!" after their writable type.

- Phil
Title: Re: Binary data not extracted for some tags
Post by: volker on March 22, 2018, 06:17:49 PM
Hi Phil,

Thanks for the quick answer. It only affects 37 tags, and they don't seem important for us.

Volker