Convert image file to standard JPEG
Firstly I apologise if this is the wrong forum to post to but I thought it was the most sensible one.
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 in to a BufferedImage object. However the trouble I'm having is that the ImageIO library only accepts common 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. I've tried a few conversion functions found online and I'm currently trying to use the Sanselan library which has been suggested in other forums.
The biggest 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. When I tried to convert these files with conversion functions given in other forums it tends to change the colours or create a load of vertical lines in the new image. Is there anyway of converting images safely and if anyones used the Sanselan library to do it can you leave an example as I'm struggling to work out how to use the library correctly.
Thanks in advanced,