I have a program which rescales images using the mortennobel image library for the rescale filter/algorithm. I'm using the Java standard library ImageIO to read the file into a BufferedImage
object. However the trouble I'm having is that the ImageIO library only accepts standard forms of images and so if the ImageIO.read()
function throws an IOException
I want to catch it and convert the image into a standard form such as a JPEG.
Just to clarify, the problem I'm having is that some of the images are not of a standard JPEG format i.e. FF D8 FF E0 JFIF
, instead they have been produced by a digital camera or edited in photoshop and the format is FF D8 FF E1 Exif
. It's possible to change this format by loading the image into a program like paint and saving again as JPEG however its not ideal for my situation as I'd like it to be automated.
Convert from: FF D8 FF E1 Exif
to FF D8 FF E0 JFIF