我只是尝试做:
File inputFile = new File("image.tif");
BufferedImage image = ImageIO.read(inputFile);
因为我认为Java 10不需要额外的库来处理tiff文件,但BufferedImage为null。
答案 0 :(得分:-1)
自JDK 9起,这应该可行:
private Image readTiffImage() throws IOException
{
final InputStream tiffImage = TiffExample.class.getResourceAsStream("image.tiff");
final BufferedImage bufferedImage = ImageIO.read(tiffImage);
final Image image = SwingFXUtils.toFXImage(bufferedImage, null);
return image;
}