You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to extract the first page from a large TIFF (15GB) using TIFFUtilities::split function
Version information
The version of the TwelveMonkeys ImageIO library in use. 3.8.2
The exact output of java --version (or java -version for older Java releases).
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc. Windows 10 64bit
To Reproduce
Steps to reproduce the behavior:
TIFFUtilities.split(new File("Large_test.tif"), new File("E:\\tmp\\"));
Expected behavior
the individual pages
Stack trace
Exception in thread "main" javax.imageio.IIOException: Integer overflow for TIFF stream
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.assertIntegerOffset(TIFFWriter.java:514)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeOffset(TIFFWriter.java:504)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeIFD(TIFFWriter.java:145)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeIFD(TIFFWriter.java:127)
The text was updated successfully, but these errors were encountered:
TIFFUtilities is currently working with 4 byte pointers only and not ready for BigTIFF files.
There are some places, where we must switch from int/long and the com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter initialisation depending on the input.
We could somehow expose the TIFF/BigTIFF flavor or pointer size in the IFD or TIFFDirectory, or just make it a parameter to TIFFPage based on the input (but then TIFFUtilities would need to figure out the input type somehow).
The TIFFWriter does handle BigTIFF already, but you need to tell it you want BigTIFF (or 64 bit pointers). But there might be some places where the TIFFUtilities methods write offsets directly, and that needs to be fixed as well. There's a method TIFFWriter.writeOffset(ImageOutputStream, long) that was made for this.
Hmmm... I started work on this, but I think I found some offset issues in the TIFFImageWriter as well, related to how we write strip/tile offsets etc. 😕
Describe the bug
I am trying to extract the first page from a large TIFF (15GB) using
TIFFUtilities::split
functionVersion information
The version of the TwelveMonkeys ImageIO library in use.
3.8.2
The exact output of
java --version
(orjava -version
for older Java releases).Windows 10 64bit
To Reproduce
Steps to reproduce the behavior:
TIFFUtilities.split(new File("Large_test.tif"), new File("E:\\tmp\\"));
Expected behavior
the individual pages
Stack trace
The text was updated successfully, but these errors were encountered: