MakerNote module with custom TIFF tag formats?

Started by Corvinus, April 17, 2013, 09:24:25 PM

Previous topic - Next topic

Corvinus

I'm trying to add a custom MakerNote module. The MakerNote has custom TIFF tag types (i.e. not SHORT / LONG / RTNL / UNDEF / ASCII / etc). I see all sorts of information about custom processing for binary tags and such, but I cannot figure out if it is possible for a MakerNote module to add custom tag *types*.

It looks like the tag gets rejected at a higher level if format is > 13 in Exif.pm and replaced with "Invalid IFD Tag". The generic makernote handling code seems to reject the whole IFD if the tag format is > 13. Is this needlessly strict? Seems like Exiftool could just treat the tag as UNDEF with no consequences. Or is there some caveat to having "invalid" TIFF tag types that I not seeing?

The README mentions "Hook" can be used to change the format, but that appears to only allow you to change from 'binary' to some other defined type?

(Disclaimer: I'll code C all day, but I'm a total newb at Perl - sorry if I'm missing something obvious).

Phil Harvey

The problem is that EXIF information is often corrupted, so ExifTool does all that it can to validate the EXIF IFD when reading.  Unfortunately, the TIFF type is one of the few things that can be validated, so this range test is necessary.  You would have to add a custom parse routine to be able to handle types > 13.

Or perhaps a better alternative is to patch lib/Image/ExifTool/Exif.pm for your own purposes, then run with a patched version.

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

Corvinus

Thanks Phil.

Given the lack of precedent for custom TIFF tag types, I've decided to redo the serialization of my binary tag values to include the type at the beginning of the data. That seems much more reasonable than determining type based on custom TIFF tag types. I'm trying to allow arbitrary data rather than having predefined tag IDs with specific formats and parse routines.

Exiftool's default makernote handling seems to be happy with the data now.