I've got a Spring MVC webapp written in Java which you can upload images too. These images need to be manipulated (resized, cropped, etc) and I'm using the Scalr library for this, which requires the images to be read from a BufferedImage.
In Java you can convert from an InputStream (which is how images come in) to a BufferedImage very easily:
final BufferedImage img = ImageIO.read(in);
However, ImageIO is really pernickety about image formats and throws all sorts of exceptions if something isn't right about the image. Users could be uploading almost any quality of image to the web app, so this isn't acceptable.
So I'm looking for an alternative. I've done some googling and one suggestion was Java Advanced Imaging from Oracle. The only problem is that it appears to rely on the Oracle Java implementation and I'm not using that.
Is there another library I can use?