How to remove 'SampleFormat' tag?

Started by Laurent LAPORTE, May 30, 2012, 03:59:10 AM

Previous topic - Next topic

Laurent LAPORTE

Hi,

I know than the 'SampleFormat' tag is read only but is it a way to remove it? This tag has the default value 'unsigned', and this value is good for me.


@see: http://www.exiftool.org/TagNames/EXIF.html
@see: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf, page 80.

I'm using Exiftool v8.50

Regards,
------- Laurent.
------- Laurent LAPORTE

Phil Harvey

Hi Laurent,

Just a warning: You risk making the image unreadable if you tamper with this tag.

That being said, use the config file below to override this tag definition and make it writable:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Exif::Main' => {
        0x0153 => {
            Name => 'SampleFormat',
            Writable => 'int16u',
            Count => -1,            # allow any number of values
            WriteGroup => 'IFD0',   # write to IFD0 by default
        },
    },
);
1; # end


- 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 ($).

cjoshua

Most of the issues people have with this is that they are not able to remove the tags just as they are needed to be dealt with.  And in that sense, I suggest that you try out how manual overriding the file would be able to solve that.  Not certain how it would turn out but I guess this would be one of those methods that would really merit favorable results, at least how we hope so.