2007.08.03 17:30 "[Tiff] bug? copying tiled tiffs over 2GB seems to break", by John

2007.08.03 19:12 "Re: [Tiff] bug? copying tiled tiffs over 2GB seems to break", by Frank Warmerdam

I have a problem with a pyramid builder I wrote. It seems to break for pyramids larger than 2GB with tiff 3.8.2. I think (I hope this is right) it's supposed to work for files up to 4GB.

Here's a small test program:


Run it with:

  gather output.tiff in1.tiff in2.tiff...

The input files need to be tiled TIFF. It just copies each one into the output file. If output.tiff is under 2GB, all is well. If output.tif goes just over 2GB, it becomes unreadable.

  john@mm-jcupitt2:~/pics$ tiffinfo output.tiff
  output.tiff: Error fetching data for field "BitsPerSample".

Is this a bug? Or am I doing something horribly wrong? Thanks!


Typically problems with file sizes between 2 and 4 GB relate to your libtiff having gotten built with a "32bit" file io API. On windows I believe you need to ensure that tif_win32.c is used instead of tif_unix.c (which works but is always 32bit with vc++ - I think). On unix it is important that the configure script identify special things required for large file support.

When I run configure on my ubuntu 64 system I see:

checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no

but large file stuff still works. But I gather on some systems some special macros may need to get defined.

OK, I've only got a weak grasp on how this magic works, but I guess my point is that at least you need to tell us what your build environment (operating system, compiler) is, and if on unix you need to review your configure output for clues.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGeo, http://osgeo.org