Image-ExifTool - Re: Deleted CR2 header

Posted on Fri Sep 5 14:08:53 2008 by exiftool in response to 8744 (See the whole thread of 5)
Re: Deleted CR2 header
Hi Uwe,

You can add back your missing CR2 headers with the following patch:

Insert the following code at line 3478 in lib/Image/ExifTool.pm version 7.41:

} else { $canonSig = 1; $$dataPt .= "CR\x02\0\0\0\0\0";

With this modification, the code should look like this:

... if ($ver > 1) { $self->Error("Windows HD Photo version $ver files not yet supported"); return 1; } } else { $canonSig = 1; $$dataPt .= "CR\x02\0\0\0\0\0"; } # we have a valid TIFF (or whatever) file ...

This patch will add the CR2 header back on a CR2 image, but it will also add a CR2 header to other TIFF-based images, so don't use it for writing other files.

To fix a file, all you have to do is write any tag. If you don't want to change anything, set any existing tag to its current value (ie. "-xresolution=72")

- Phil
Direct Responses: 8752 | Write a response