This worked, and now it does not work. I have not changed the part in which the image should appear, so I do not know why this does not work. Here is a snippet of my code:
File f = new File(filepath);
applicantImage=new ImageDetail(filepath);
Iterator<ImageReader> readers =
ImageIO.getImageReadersBySuffix(applicantImage.getFile_extension());
ImageReader reader = readers.next();
ImageInputStream iis = ImageIO.createImageInputStream(f);
filepath- This is the absolute path to the file, and the image is confirmed that it is in this place on the server. Everything works fine and dandy until it gets to ImageIO.createImageInputStream(f). Now it returns null. I read javadoc that it accepts a file. So why is he returning nullnow? Somebody knows? None of the above codes have been changed in my editing, so I don’t understand why it worked before the change and why it does not work now. Any help is much appreciated! Thank!
source
share