![]()
|
||||
OOP ImageUtil API: Java API to convert JPEG, PNG, GIF and WBMP images to/from BufferedImage by JAIImageUtil is the Java API to scale down JPEG, PNG, GIF and WBMP images by JAI (Java Advanced Imaging API). The width/hight of the image can be reduced to fit within the specified rectangle. ImageUtil also implements methods for converting the binary contents in JPEG, PNG, GIF and WBMP to/from a BufferedImage object. Putting it all togather : OOP Bento frameworkThis Java API is now a part of OOP Bento framework. In this MVC framework by XML, you can write all the GUIs in the web application in the normal HTML, XHTML, WML, HDML or any other mark-up languages. And you no longer need to bother about the user authentication and the session tracking. Because its full working source code example will be the good starting point of this Java API, please also visit the web site of Bento framework. Related Pages:
|
||||
Introduction ...ImageUtil is the Java API to scale down JPEG, PNG, GIF and WBMP images by JAI (Java Advanced Imaging API). The width/hight of the image can be reduced to fit within the specified rectangle. The ratio of width/height of the original image will be left unchanged. This Java API is useful to show the large image on the small screen of the WAP phone (mobile phone). For instance, Servlet can send the binary contents of the scaled JPEG image to the WAP device.
Do you need BufferedImage?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.
IIOException: Unexpected block type 0! on GIFJava Image I/O API was introduced in JDK 1.4 . And you can use:
to obtain an ImageReader object for the specific image format. The ImageReader object reads the binary contents from the image file, and returns the BufferedImage object. But, ImageReader for GIF has a bug and throws:
when it reads some GIF files. For details, please read: 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.
DownloadThis API is now a part of Bento framework. There are the better documentations and source code examples on the web site for Bento framework. There, you will also find the link to download the entire framework or each API in it. |
|
|||
|
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries. |
||||
|
ALL CONTENTS COPYRIGHT 1997-2007, OOP-Research Corporation. All rights reserved. |
||||