bioformats
bioformats copied to clipboard
TiffWriter: incorrect BigTIFF threshold
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: https://github.com/ome/bioformats/blob/e484e1faefd6c7590fa5dbb56e56f3cc360d9139/components/formats-bsd/src/loci/formats/out/TiffWriter.java#L381-L387
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.
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