Page 1 of 1

TIFF file size limit

Posted: 2011-02-16T20:39:41-07:00
by Drarakel
Hi,

I'm processing some large TIFF files - and noticed that files over 2 GiB don't work in ImageMagick (at least with my IM installations). Strange that I didn't notice this before..
Is this a known limitation - or a bug? Or perhaps a Windows specific problem (I'm on Windows)? I only found an old thread, which suggests that the large TIFF files once worked in IM. And 'regular' TIFF files can have up to 4 GiB - right?

Small test case:

Code: Select all

convert -depth 16 -size 18000x20000 xc:blue -compress none test.tif
identify test.tif
Magick: Not a TIFF file, bad magic number 17 (0x11). `test.tif' @ error/tiff.c/TIFFErrors/496.

This creates a TIFF file with over 2 GiB. Normally, IM writes the TIFF directory at the end of the file, I think. But here, IM overwrites the beginning of the file with part of the directory. So, the file is corrupt.

And when reading valid, large TIFF files, I'm getting errors like "Seek error at scanline ..." or "Seek error accessing TIFF directory" (the data over 2GiB can't be accessed). Perhaps IM uses signed integers for the addresses in TIFF files or something like that..?

I'm using the latest IM Win32 Q16 version (v6.6.7-7). The included libtiff version is 3.9.2 (but libtiff itself is ok, I think).

Re: TIFF file size limit

Posted: 2011-02-17T12:09:16-07:00
by magick
We can reproduce the problem you reported and have a patch. Look for it in the next point release of ImageMagick.

Re: TIFF file size limit

Posted: 2011-02-23T07:21:38-07:00
by Drarakel
I've tested it - and yeah, the large TIFF files now work in the current IM versions (up to 4GiB). Thank you!