2004.09.16 19:12 "[Tiff] BigTIFF Tag Value Count issue", by Joris Van Damme

2004.09.17 12:46 "Re: [Tiff] BigTIFF Tag Value Count issue", by Rob van den Tillaart

** Option 0: stick with 4 byte tag count members **
(Alignment, tag data <=4 gig, Frank's choice)

0 - U16 - Tag identifying code
2 - U16 - Datatype of tag data
4 - U32 - Number of values
8 - U64 - Tag data or offset
16

** Option 1: make it an 8 byte tag count **
(No alignment, tag data > 4 gig allowed, no votes sofar)

0 - U16 - Tag identifying code
2 - U16 - Datatype of tag data
4 - U64 - Number of values
12 - U64 - Tag data or offset
20

** Option 2: make it 8 byte tag count, add 4 padding bytes **
(Alignment, tag data > 4 gig allowed, Bob's choice)

0 - U16 - Tag identifying code
2 - U16 - Datatype of tag data
4 - 4 bytes padding - Unused
8 - U64 - Number of values
16 - U64 - Tag data or offset
24

** Option 3: make it 8 byte tag count, extend previous 2 members to 4 bytes **
(Alignment, tag data > 4 gig allowed)

0 - U32 - Tag identifying code
4 - U32 - Datatype of tag data
8 - U64 - Number of values
16 - U64 - Tag data or offset
24

Rob, am I to understand you like option 3 best, or were you merely signalling the possibility?

Primary signalling, but I prefer opt. 3 for the following reasons:

- it creates plenty of room for new TAGS.
- it aligns the smallest field to 32 bit
        => aligns with 32bit processors which are most abundant in the world.
        => no need for masking to access fields
        => OK, 64 bit processors still have to mask.
- more important: debugging a hexdump of an BIGTIFF becomes easier as one search 32 bit aligned (this point was mentioned a few months ago)

The Number of values must be U64 too as my tag might describe an additional value for every pixel of the image. And as the image can be > 4gig. this array will too. (see below for example)

I agree that that 4 bytes for datatypes is quite high. However this opens the door to have dedicated datatypes for dedicated tags, and to have higher level datatypes (e.g. structs). Imagine a bitmap of the earth, and my new tag describes an overlay of the strength of the magnetic flux for every pixel. Or an 'mp3' tag to have background music, etc

regards,
rob