TIFF file size limit

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

TIFF file size limit

Post 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).
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF file size limit

Post by magick »

We can reproduce the problem you reported and have a patch. Look for it in the next point release of ImageMagick.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: TIFF file size limit

Post by Drarakel »

I've tested it - and yeah, the large TIFF files now work in the current IM versions (up to 4GiB). Thank you!
Post Reply