0

I'm trying to render a TIF file using the standard Java APIs, JAI and ImageIO:

RenderedOp op = JAI.create("fileload", new File("C:\\test.tif").getAbsolutePath());

or

BufferedImage image = ImageIO.read(new File("C:\\test.tif"));

In both I get the fallowing error:

EOL code word encountered in White run.

I have the latest versions of jai_core, jai_codecs and jai_imageio on my classpath.

I tried to open the same image in other apps like The Gimp and Windows Image Viewer, and they can open it properly, although the bottom half appears to be missing.

Any idea what seems to be the problem?

4

1 回答 1

0

在研究了一些库(包括本地库)之后,我能够使用JIMI Software Development Kit渲染 TIF ,这是 Oracle (Sun) 的一个库。在页面中,据说这个工具包将用于旧的 Java 平台,但在我的情况下它解决了这个问题。

示例代码:

    JimiCanvas jCanvas = new JimiCanvas();
    jCanvas.setImagePath("C:\\test.tif");
    Image image = jCanvas.getImage();
于 2012-03-01T11:42:48.153 回答