주어진 이미지를 압축하고 JPEG로 저장하는 프로그램을 작성 중입니다.javax.imageio.IIOException : 입력 파일을 읽을 수 없습니다
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);
}
이미지 경로에 슬래시가 있어야합니까? – Sinkingpoint
@Quirliom 와우 그게 그렇게 간단했습니다! 그게 효과가 있었어, 고마워요 :) – pacman4565
이 질문에 대한 답변을 추가하거나 도움이 되었다면 아래 답변을 수락하십시오. 지금 이것은 다른 사람들에게별로 도움이되지 않습니다. – Gray