Ok I have an Image that I\'m trying to read. Problem is that the Image.read(file) returns NULL.
File file = new File(\"C:\\\\images\\\\image1.jpg\");
if(file.exi
Awesome, I had the same problem, wherein it was supporting 24 image formats in eclipse but was supporting only 12 image formats in command prompt with maven. Once I placed jai_imageio.jar in maven's test path, maven has begun to support 24 image formats as well.
Ok since I switched laptops, I looked at my old laptop and found this JAR jai-imageio.jar in the jre/ext/lib (I know bad idea). I moved it to my project/lib and it worked! I guess this jai-imageio.jar contains additional image readers.
From the Javadocs for ImageIO.read()
Returns a
BufferedImageas the result of decoding a supplied File with anImageReaderchosen automatically from among those currently registered. TheFileis wrapped in anImageInputStream. If no registeredImageReaderclaims to be able to read the resulting stream,nullis returned.
Try creating an ImageInputStream, then pass that onto the ImageIO.read() method, instead of sending the file itself.