Borland Developer Network

Borland JBuilder Partner CD

JBuilder

Trial

ImageUtil

Personal, Standard, Enterprise

ImageUtil (ID #24191)


OOP-Reserch Corporation

When the image file is uploaded to your Servlet, its binary contents will be available in JPEG, PNG or GIF format. To manipulate the uploaded image file, those binary contents should be converted to a BufferedImage object. After your Servlet finishes to work on a BufferedImage object, it should be serialized back into the binary contents in JPEG, PNG, GIF or WBMP format to be send back to the web browser or to be stored into the SQL table. ImageUtil implements methods for converting the binary contents in typical image formats to/from a BufferedImage object.

Java Image I/O API was introduced in JDK 1.4 . And you can use:
* javax.imageio.ImageIO
to obtain an ImageReader object for the specific image format.
ImageReader object reads the binary contents from the image file, and returns the BufferedImage object. But, ImageReader for GIF has a bug and throws:
* Get IIOException: Unexpected block type 0! on GIF file
when it reads some GIF files.
Even in case of such a GIF file, ImageUtil can read and return a BufferedImage object. So, this API will be the good workaround for the bug in JDK.

Install ImageUtil

ImageUtil home page