English 中文(简体)
Apache-Sanselan AIOOBE 部族-阿帕契族共产主义在解压包装时
原标题:Apache-Commons Sanselan AIOOBE when decompressing PackBits TIFF

当试图使用阿帕奇-桑塞兰共产主义共产主义(Sanselan)来装载一个用包装压缩压缩压缩压缩的TIFF时,框外的ArrayIndex outsout ofboundsExpection。

守则:

import org.apache.sanselan.*;

public class TIFFHandler {
    public static Image loadTIFF(String fileName) throws ImageReadException, IOException {
        File imageFile = new File(fileName);
        BufferedImage bi = Sanselan.getBufferedImage(imageFile);
        return bi;
    }

    public static void main(String[] args) throws IOException, ImageReadException {
        String TIFFFILE = "test_image.tif";
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        BufferedImage bi = (BufferedImage) loadTIFF(TIFFFILE);
        ImageIcon ii = new ImageIcon(bi);
        JLabel lbl = new JLabel(ii);
        panel.add(lbl);
        frame.setVisible(true);
    }
}

堆叠跟踪 :

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 426
at org.apache.sanselan.common.PackBits.decompress(PackBits.java:55)
at org.apache.sanselan.formats.tiff.datareaders.DataReader.decompress(DataReader.java:127)
at org.apache.sanselan.formats.tiff.datareaders.DataReaderStrips.readImageData(DataReaderStrips.java:96)
at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:505)
at org.apache.sanselan.formats.tiff.TiffDirectory.getTiffImage(TiffDirectory.java:163)
at org.apache.sanselan.formats.tiff.TiffImageParser.getBufferedImage(TiffImageParser.java:441)
at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1264)
at org.apache.sanselan.Sanselan.getBufferedImage(Sanselan.java:1255)
at TIFFHandler.loadTIFF(FieldSheetHandler.java:42)
at TIFFHandler.main(FieldSheetHandler.java:90)

我试图分析这个问题,但我迷路了...任何方向都会很有帮助。

最佳回答

您可以从 Apache 快照存储处尝试更新的普通图像图像版本。 Javadoc 尚未上网, 您将不得不通过 < a href=" http://commons.apache. org/imaging/ source- repository. html" rel=“ nofollow” 查看 SVN 的代码, 并运行 mvn javadoc:javadoc

如果您发现更多问题或想要建议改进, 您可以在 < a href=" https://issues.apache.org/jira/browse/IMAGING" rel=“ nofollow” >JIRA 中将其归档。 如果您对API的使用有疑问, 开发者也会很乐意帮助您。 他们在 < a href=> 上等你 http://commons.pache.org/imaging/mail-lists.html" rel=“ nofolfolting” > 邮件列表 。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签