JSP Image Tag Library

[ printable version ]
 

JSP Tag libraries

Imaging Taglib - http://jakarta.apache.org/taglibs (sandbox)

License: Apache License ( http://www.apache.org)
Download: jakarta-taglibs-sandbox/image
Technologies: J2EE, Java2D, ImageIO, Java Advanced Imaging

A set of JSP Custom Tag libraries for dynamic image manipulation that can replace the <img> tags of HTML.

The Image Tag library has tags that will help the JSP page developer to present slightly different variations of existing image/images in the page. Typical uses are thumb-nailing, changing contrast, brightness, color shades, gray-scaling, scaling, image/ text overlay, etc. Implementations using Java 2D API, Java Advanced Imaging API and Standard Windowing Toolkit are being developed.

For those who do not want to install the WAR file but would still like to see the output of the examples, I have uploaded the saved output files. These are not dynamic anymore.
1. Overlay/ write Text on a Cropped image after Resizing (JPEG)

<img:image src="/images/splash.jpg" name="gs.jpg" refresh="true" >
  <img:crop x="0%" y="25%" width="100%"	height="30%"/>
  <img:resize scale="200%"/>
  <img:text text="A part of the Jakarta Tag library" x="2" y="95%"
font="Arial" bold="true" size="16" color="0x440000"/>
</img:image>
Output :



2. Rotation after Resizing (GIF converted to PNG)
<img:image src="/images/new.gif" name="sr.png" refresh="true">
	<img:resize scale = "80%" />
	<img:rotate degrees="-30" />
</img:image>
Output :



3. A colored Border to an image with an image (the one generated above) Overlaid. The white background is set as the transparency color (JPEG)
<img:image src="/images/splash.jpg" name="brdr.jpg" refresh="true" >
  <img:border width="10" height="5" color="0x44dd44" />
  <img:overlay x="5%" y="50%" name="sr.png" color="0xffffff" tolerance="35"
/>
</img:image>
Output :



4. Overlay a transparent image on a Grayscaled image and Resized (PNG on JPEG)
<img:image src="/images/splash.jpg" name="gr.jpg" refresh="true"
imagingType="JAVA2D">
  <img:grayscale/>
  <img:overlay x="2%" y="2%" src="/images/new.png" />
  <img:resize scale = "70%" />
</img:image>
Output :



Multipart Taglib - http://jakarta.apache.org/taglibs (sandbox)

A set of JSP Custom Tag libraries for parsing and retrieving data from a "multipart form-data" form with/ without file uploads.
The Multipart Tag library uses the Jakarta Commons FileUpload library heavily. It includes a set of custom tags to retrieve parameters, uploaded file content, saved as files, archive a set of uploaded files, populate java beans, etc.

 
 

 

 


Thank you for visiting. Send me your feedback.