gpt4 book ai didi

javax.imageio.IIOException : Can't read input file 异常

转载 作者:搜寻专家 更新时间:2023-11-01 03:56:46 27 4
gpt4 key购买 nike

<分区>

我正在构建一个压缩给定图像并将其保存为 JPEG 的程序。这是我收到的错误消息:

Exception in thread "main" javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(Unknown Source)
at JPEGCompression.main(JPEGCompression.java:23)

这是我的主要内容:

public class JPEGCompression {

public static void main(String[] args) throws IOException{

String imageFile = "/tmp/garden.png";
BufferedImage i = ImageIO.read(new File(imageFile)); // this line produces the error
showImage("Original Image", i);

compressAndShow(i, 0.7f);


}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com