Just as a first step in a Java project I'm trying to get a image loaded into BufferedImage, I only succeed in getting the error message "cant read input file". I tried placing the image in asource folder within the project and giving the path of the image on my computer but I cant seen to get it to work.
package imageProcessing;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class image
{
public image()
{
try
{
// the line that reads the image file
BufferedImage image = ImageIO.read(new File("me.jpg"));
// work with the image here ...
}
catch (IOException e)
{
// log the exception
// re-throw if desired
}
}
public static void main(String[] args)
{
new image();
}
}