1997.05.02 07:04 "BIG TIFF file problems", by Hans Christiansen

1997.05.02 09:17 "Re: BIG TIFF file problems", by Bjorn Brox

I am having problems with very large tiff files created by our RIP software.

The tiff file created is a bilevel tiff comprising of uncompressed data in a single strip!! The size of the file is 707,953,939 bytes.

WOW!

  # tiffcp -s -c lzw a1.tif a1c.tif
  a1.tif: Warning, incorrect count for field "StripOffsets" (1, expecting
  111); tag ignored.

This error message is correct, see below:

I have a theory as to why this is happening:

Looking at a tiffdump of the file:

  # tiffdump a1.tif

  ImageWidth (256) LONG (4) 1<85640>
  ImageLength (257) LONG (4) 1<66133>
 

  StripOffsets (273) LONG (4) 1<174>
  RowsPerStrip (278) SHORT (3) 1<597>
  StripByteCounts (279) LONG (4) 1<707953765>
 

I noticed that the width (85640) multiplied by the height (66133) (=5,663,630,120) exceeds the maximum possible value of the type uint32 which is 4,294,967,295. It is this 'overflow' that causes tiffcp to fail!

The file tells: RowsPerStrip 597.

This means that there have to be (ImageLength + ImageLength - 1)/RowsPerStrip StripOffset and StripByteCounts values too, i.e. 111.

I am wondering if anyone agrees with my theory.

Well, you migth also get these kinds of errors, but by dividing the file into strips this error can be avoided.

--
Bjorn Brox, mailto:brox@corena.no, CORENA A/S, http://www.corena.no/
P.O.Box 1024, Kongsberg Naeringspark, N-3601 Kongsberg, NORWAY
Phone: +47 32 73 74 35, Fax: +47 32 73 68 77, Mobile: +47 92 63 85 90