posted 18 years ago
I am trying to read in am image from a file. I am using the following code:
Image image = null;
try {
// first attempt
image = ImageIO.read(new File("image.jpg"));
// second attempt
InputStream is = new BufferedInputStream(
new FileInputStream("image.jpg"));
image = ImageIO.read(is);
} catch (IOException e) {
}
I have the two different ways that I am trying to read in the image and both do not work. I eventaully want to stick the image in the database, but that is another story. Thank you in advance.