Skip to content
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

TiffWriter: incorrect BigTIFF threshold #4113

Open
dgault opened this issue Nov 1, 2023 · 1 comment
Open

TiffWriter: incorrect BigTIFF threshold #4113

dgault opened this issue Nov 1, 2023 · 1 comment

Comments

@dgault
Copy link
Member

dgault commented Nov 1, 2023

Issue was raised on forum thread https://forum.image.sc/t/possible-bio-formats-bfconvert-bigtiff-threshold-bug/88042

The user reported an exception when attempting to write 8 planes each of 429.9 Mb so a total data size of 3.44Gb. An exception is then thrown from the TiffWriter as it checks if there is enough space for 2 full planes from the end of the output stream:

if (!isBigTiff) {
isBigTiff = (out.length() + 2
* (width * height * c * bytesPerPixel)) >= 4294967296L;
if (isBigTiff) {
throw new FormatException("File is too large; call setBigTiff(true)");
}
}

I was able to reproduce locally by writing an uncompressed file of size 12000 * 20000 * 2 * 8. If I manually override the check then a valid TIFF file is written under the threshold size and validates with tiffinfo.

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/possible-bio-formats-bfconvert-bigtiff-threshold-bug/88042/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants