• Notice: Undefined index: href in oa_comment_preprocess_comment() (line 113 of /easy/www/tiffa-intranet/profiles/openatrium/modules/apps/oa_comment/oa_comment.theme.inc).
  • Notice: Undefined index: href in oa_comment_preprocess_comment() (line 113 of /easy/www/tiffa-intranet/profiles/openatrium/modules/apps/oa_comment/oa_comment.theme.inc).

What does it mean for a tag to have a 0 count?

I've come across a few TIFFs that libtiff flags a warning because the tag has a zero count.

For example, this is an EXIFIFDOffset tag from a little endian file written by Photoshop 7 back in 2003
6987 0400 00000000 00000000
Imagemagick's convert passes the following warning from libtiff
convert: Incorrect count for "EXIFIFDOffset"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/891.

When I tweak that tag to a fake private tag value
6887 0400 00000000 00000000
Imagemagick's convert passes the following error from libtiff

I'm not sure if the 6.0 spec has any rules about the count part of the tag must be > 0. At the bottom of page 15, there is this. "Note that there is no initial “count byte” as in Pascal-style strings." I'm not familiar with Pascal, so I'm not sure what that means.

Regardless, tags with a 0 count appear to be problematic, at least from their interpretation by libtiff. Should this be addressed in the TI/A spec?

Comments

#1

By my reading of the TIFF V6 spec, there's nothing forbidding a zero count. There are a few cases where it could even make sense, such as FreeByteCounts and FreeOffsets. If there are no blocks of free storage within the file, then these tags could have a count of zero. However, the documentation of the tags says, "Not recommended for general interchange. This tag is mostly abandonded, it was an attempt at memory management inside TIFF files that did not succeed." So unless there's another case where a zero count makes sense and is actually used in some cases, I'd suggest disallowing a count of zero in any tag.

#2

In short: yes.