阅读大型TIFF文件时问题

发布于 2025-01-23 07:57:33 字数 901 浏览 5 评论 0 原文

使用 javax.imageio jai ,我将面临I/O错误作为TIFF文件时面对I/O错误。

这是我所做的:

Generate a random BufferedImage of type TYPE_CUSTOM with DataBufferInt encoding
Save the image as a TIFF file using javax.imageio or JAI
Read the image using javax.imageio or JAI
Compare the original image with the image saved/read

事实证明,只要图像尺寸小于31kx31k ISH,一切都可以正常工作,但是如果它们更大,那么图像的顶部就会变得不同。

我在线查看,发现此 bug Reports 。如果我正确阅读了它,则应该已经修复了Java 11.0.13,请参见。当我使用OpenJDF 11.0.2时出现此错误,因此我尝试使用OpenJDK 11.0.14.1 2022-02-08和OpenJDK 17.0.2 2022-01-18,但我仍然有同样的问题。我没有此错误报告的例外,所以它很接近,但可能没有关系。

所以我的问题是:

  • 我没有正确理解什么?
  • 还有另一种更好/更安全的处理TIFF图像的方法吗?

I'm facing an I/O bug when using large images as a TIFF file using javax.imageioand JAI.

Here is what I did:

Generate a random BufferedImage of type TYPE_CUSTOM with DataBufferInt encoding
Save the image as a TIFF file using javax.imageio or JAI
Read the image using javax.imageio or JAI
Compare the original image with the image saved/read

It turns out that everything works fine as long as the images dimensions are smaller than 31Kx31K ish, but if they are bigger then the top part of the image becomes different.

I looked online and I found this bug report. If I read it correctly, it should have been fixed since java 11.0.13, see this bug report. This bug appeared while I was using OpenJDF 11.0.2, so I tried using openjdk 11.0.14.1 2022-02-08 and openjdk 17.0.2 2022-01-18, but I still have the same issue. I don't have an exception as this bug report, so it's close but might not be related.

So my questions are:

  • What am I not understanding correctly?
  • Is there another better/safer way to handle TIFF images?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文