-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing large TIFFs is not supported #80
Comments
Hello, the field is already using a "long" value, I think. In the TIFF specifications the "long" value is a 32-bit (4-byte) unsigned integer. The header is defined at line 1372, TIFFField stripOffsetsField (and in some other location in same file) using TIFF.LONG type, so the only thing that you can check is if the long Java value is really converted to an unsigned 32bit integer. Best regards |
Correct, my bad, you would have to support BigTIFF (https://en.wikipedia.org/wiki/TIFF#BigTIFF). It is still a bug in a sense that your implementation is limited to 2^31 pixels, while it could be 2^32 -- you would need to cast the long into an int so that it is saved as an unsigned int, like we do it in ImgLib2: Thanks so much, |
Happy to make a pull-request if you like ... it would maybe also be better to throw an exception if the file size exceeds 2^32 pixels instead of silently failing? |
Agree on throwing an exception if it's out of bounds. If you want to support longs up to 2^32-1 without going for BigTiff, then I think you would have to fake the equivalent negative int (Note: NOT Somthing like I think you can't write with |
Are there any plans to support BigTIFF in nearest future? Now I'm using SCIFIO for reading/writing large TIFF, and I would like to use JAI instead, but I need correctly process BigTIFF SVS files. |
Hi, I wanted to use the TIFFImageWriter.java class to write large TIFFs in strips. However, the writing is limited to a maximal size of 2^31 pixels because the stripOffsets are written as int's and not as long's:
jai-imageio-core/src/main/java/com/github/jaiimageio/impl/plugins/tiff/TIFFImageWriter.java
Line 2664 in f81bc1a
I wanted to ask if there is an easy fix for that? Just writings longs there does not work since it needs to be specified in the header somehow as well that longs are used for stripOffsets, but wasn't able to find out where this is defined.
Thanks so much,
Stephan
The text was updated successfully, but these errors were encountered: