Help me find a bug
package com.example.test; import java.awt.Color; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class LoadImage { /** подгружаем картику */ public static BufferedImage loadImage() throws IOException{ return ImageIO.read(new File ("1.bmp")); } /** Переводим в матрицу */ public static void convertToMatrix(BufferedImage image){ int w = image.getWidth(); int h = image.getHeight(); System.out.println(w); System.out.println(h); } } package com.example.test; public static void main(String[] args) { try { LoadImage.convertToMatrix(LoadImage.loadImage()); } catch (Throwable e) { e.printStackTrace(); } } Here is the error code:
javax.imageio.IIOException: Can't read input file! at javax.imageio.ImageIO.read(ImageIO.java:1301) at com.example.test.LoadImage.loadImage(LoadImage.java:16) at com.example.test.Test.main(Test.java:10) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Process finished with exit code 0 I understand it does not see the picture?
