Red Hat Bugzilla – Bug 71507
Files larger than 2Gb not supported
Last modified: 2015-03-04 20:11:16 EST
Description of Problem:
TIFF is supposed to support images with raster data size to 4Gb, but libtiff is
actually unable to write files larger than 2Gb, presumably because "large file"
support is not enabled for I/O operations/
Version-Release number of selected component (if applicable):
- and also 3.5.7-2 on RedHat 7.3, I believe.
Steps to Reproduce:
1. Write tiff file >2Gb but <4Gb... Not sure what's the easiest way.
'tiffcp <lots of files> out.tif', perhaps.
Filesize limit exceeded (core dumped)
TIFF file created
This is a major issue to us even given the 4Gb limitation of the TIFF format as
the output from scanning a typical map or drawing (which is what we do) in RGB
at 1000dpi has a size of between 2 and 3Gb.
I am working on a patch right now.
Created attachment 70784 [details]
Enable 64-bit I/O
Attached patch should fix this problem. I have created, then viewed a 2.6Gb
(32000 by 28000 pixels RGB) file with this code.
1. _LARGEFILE64_SOURCE (which in turn defines __USE_LARGEFILE64) + O_LARGEFILE
was not enough; write appeared to be successful with these, but the resulting
file was not valid. Instead, full(er) 64-bit support had to be enabled via
#define _FILE_OFFSET_BITS 64
Hopefully, this won't hurt performance too much.
2. tiffdump still won't handle >2Gb files as it uses direct (signed 32-bit)
open() rather than (now 64-bit) libtiff functions. Of course, it could easlily
be updated in a similar manner.
3. I'm right now trying to find out what happens when the 4Gb limit is reached.
Wow, thanks for the detailed report and fix.
I'll certainly include it in the next libtiff build i'm doing.
Read ya, Phil
OK, latest rawhide version of libtiff contains your fix.
Read ya, Phil
Good. Thanks for the quick response!