You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ab...@apache.org on 2004/04/19 16:33:20 UTC

cvs commit: jakarta-taglibs-sandbox/image/doc/web/images splash-new-gray.jpg

abey        2004/04/19 07:33:19

  Modified:    image/xml intro.xml image.xml
               image/examples/web/WEB-INF/lib pmiw.jar
               image/lib pmiw.jar
               image/examples/web index.jsp
               image/doc/web/images splash-new-gray.jpg
  Log:
  Added Transparency Tag - Abey
  
  Revision  Changes    Path
  1.2       +4 -0      jakarta-taglibs-sandbox/image/xml/intro.xml
  
  Index: intro.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/image/xml/intro.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- intro.xml	6 Oct 2003 16:46:30 -0000	1.1
  +++ intro.xml	19 Apr 2004 14:33:19 -0000	1.2
  @@ -33,6 +33,10 @@
     <section name="Image News" href="News">
     
       <news>
  +      <newsitem date="16/04/2004">
  +      	Added a new tag to add Transparency to images. This is useful before
  +      	overlaying images.       
  +      </newsitem>    
         <newsitem date="10/03/2003">
         	The Image taglib is now available in the sandbox for testing 
         	and evaluation.        
  
  
  
  1.3       +97 -24    jakarta-taglibs-sandbox/image/xml/image.xml
  
  Index: image.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/image/xml/image.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- image.xml	8 Oct 2003 09:47:08 -0000	1.2
  +++ image.xml	19 Apr 2004 14:33:19 -0000	1.3
  @@ -57,8 +57,8 @@
   		    &quot;Poor Man's Imaging Wrapper&quot; (PMIW)</a>, a simple imaging wrapper library. 
   		    This wrapper exposes a very simple interface for imaging operation using 
   		    Java2D, JAI, etc. It is distributed under the Apache software 
  -		    license and the binary is included in the WAR file distribution. The source
  -		    and binary of PMIW can be obtained from the taglibs CVS or from the 
  +		    license and the binary is included in this taglib distribution. The source
  +		    of PMIW can be obtained from 
   		    <a href="http://www.mullassery.com/software/PMIW">PMIW project home</a>.
   		    It was not made part of this library because it is used for other projects
   		    such as ANT image tasks, etc.</li>
  @@ -160,6 +160,7 @@
           &lt;img:image src=&quot;/images/new.gif&quot; &gt;
               &lt;img:rotate degrees=&quot;-30&quot; /&gt;
               &lt;img:resize scale=&quot;80%&quot; /&gt;
  +            &lt;img:transparency level=&quot;125&quot; /&gt;            
           &lt;/img:image&gt;        
       &lt;/img:overlay&gt;
       &lt;img:resize scale=&quot;75%&quot; /&gt;
  @@ -230,7 +231,7 @@
   		    tags to do transformations on it. The read is based on the 
   		    available Imaging capability. If Java Advanced Imaging classes or
   		    ImageIO classes are available, numerous image formats can be 
  -		    read. If not, the default Java 1.2 AWT supports only reading
  +		    read. If not, the default Java-1.2 AWT supports only reading
   		    JPEG or GIF. Encoding the output in the GIF format is not 
   		    supported. It avoids throwing errors whenever possible.
   		    If it is used as a nested tag, it just loads and passes it to the
  @@ -247,7 +248,7 @@
               <name>src</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		An absolute or relative URL of the an image. The image is loaded
           		from this URL if the image file specified in the image attribute
  @@ -259,7 +260,7 @@
               <name>name</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The file name for the output image. The format/ encoding of the output
           		image is decided from the extension on this name. The tag searches
  @@ -273,7 +274,7 @@
               <name>dir</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The output file is generated in and reloaded from this directory. 
           		This is expected relative to the context path. The default value 
  @@ -308,7 +309,7 @@
               <name>attributes</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		All the attributes that needs to be included in the HTML img tag can 
           		be included in this attribute. It is just a direct copy of the String 
  @@ -321,7 +322,7 @@
               <name>imagingType</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The output file is generated in and reloaded from this directory. 
           		This is expected relative to the context path. The default value 
  @@ -377,7 +378,7 @@
               <name>scale</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The scale is specified as a percentage of the image's dimensions, for eg.,
           		&quot;50%&quot; means that the width and height of the image will be 
  @@ -392,7 +393,7 @@
               <name>width</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The width of the output image can be specified as number of pixels wide
           		OR as a percentage of the current width. In either case, if the height
  @@ -405,7 +406,7 @@
               <name>height</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The height of the output image can be specified as number of pixels high
           		OR as a percentage of the current height. In either case, if the width
  @@ -485,7 +486,7 @@
               <name>x</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The horizontal distance from the top-left corner of the current image to the 
           		point where the new image is painted (the top-left corner of the new image). 
  @@ -497,7 +498,7 @@
               <name>y</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The vertical distance from the top-left corner of the current image to the 
           		point where the new image is painted (the top-left corner of the new image). 
  @@ -509,7 +510,7 @@
               <name>color</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		A color can be specified to be made transparent. This is particularly useful to
   				remove/ignore the black/ white background of images that does not support transparency.
  @@ -559,6 +560,60 @@
           </example>
       </tag>
       <tag>
  +        <name>transparency</name>
  +        <tag-class>org.apache.taglibs.image.TransparencyTag</tag-class>
  +        <body-content>JSP</body-content>
  +        <display-name>Transparency</display-name>
  +        <description>
  +	    	This nested/ child tag of the <code>&lt;image&gt;</code> tag can add 
  +	    	transparency to an image. This is usually useful if you want an overlaid image
  +	    	to be translucent.
  +        </description>
  +	    <summary>
  +        	This tag makes the image translucent. It supports 255 levels of tranparency.
  +		</summary>
  +	    <availability>1.0</availability>
  +	    <restrictions>None</restrictions>
  +        <attribute>
  +            <name>level</name>
  +            <required>false</required>
  +            <rtexprvalue>true</rtexprvalue>
  +            <type>int</type>
  +        	<description>
  +        		The level value is used to specify the amount of transparency to be added. It can range from 
  +        		0 (no change) to 255 (fully transparent). Note that the transparent pixels and semi-transparent 
  +        		will also be affected.
  +        	</description>
  +        	<availability>1.0</availability>            
  +        </attribute>                         
  +        <example>
  +		    <usage>
  +			    <comment>
  +			    	This example loads an image &quot;splash.jpg&quot;.
  +			    	It then loads another image &quot;asf-logo&quot;, adds transparency of &quot;125&quot; 
  +			    	(half opaque/ transparent) and overlays it on the parent image. The color &quot;white&quot; 
  +			    	(&quot;0xffffff&quot;) in the &quot;asf-logo.jpg&quot; is treated as transparent while 
  +			    	overlaying.
  +			    </comment>
  +			    <code>
  +			    	<![CDATA[
  +<img:image 
  +	src="images/splash.jpg"  
  +	name="splash-thumb.jpg" >
  +	
  +	<img:overlay x="10%" y="60%" color="0xffffff" tolerance="35">	
  +		<img:image src="/images/asf-logo.jpg">
  +			<img:transparency level="125" />
  +		</img:image>	  
  +	</img:overlay>
  +	
  +</img:image>			    	
  +					]]> 
  +			    </code>
  +		    </usage>        
  +        </example>
  +    </tag>
  +    <tag>
           <name>rotate</name>
           <tag-class>org.apache.taglibs.image.RotateTag</tag-class>
           <body-content>empty</body-content>
  @@ -653,7 +708,7 @@
               <name>color</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The color of the border can be specified as an integer, for e.g., 
           		&quot;0xff0000&quot; for red. This will be decoded to obtain the color.
  @@ -747,7 +802,7 @@
               <name>x</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The horizontal distance from the top-left corner of the current image to the 
           		point where the cropping begins. The value can be in the number of pixels OR 
  @@ -759,7 +814,7 @@
               <name>y</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The vertical distance from the top-left corner of the current image to the 
           		point where the cropping begins. The value can be in the number of pixels OR 
  @@ -771,7 +826,7 @@
               <name>width</name>
               <required>true</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The width of the output sub-image is specified relative to the &quot;x&quot;
           		attribute. The value can be in the number of pixels OR as a percentage of the 
  @@ -783,7 +838,7 @@
               <name>height</name>
               <required>true</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The height of the output sub-image is specified relative to the &quot;y&quot;
           		attribute. The value can be in the number of pixels OR as a percentage of the 
  @@ -832,7 +887,7 @@
               <name>x</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The horizontal distance from the top-left corner of the current image to the 
           		point where the text begins. The value can be in the number of pixels OR 
  @@ -844,7 +899,7 @@
               <name>y</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The vertical distance from the top-left corner of the current image to the 
           		point of the  where the text begins. This point is the BASE of the font/text
  @@ -859,7 +914,7 @@
               <name>text</name>
               <required>true</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The String value that should be written/painted on the image.
           	</description>
  @@ -869,7 +924,7 @@
               <name>font</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The name of the font in which the text has to appear. Make sure that this font 
           		is available. The default font is &quot;SanSerif&quot;
  @@ -891,7 +946,7 @@
               <name>color</name>
               <required>false</required>
               <rtexprvalue>true</rtexprvalue>
  -            <type>java.lang.String</type>
  +            <type>String</type>
           	<description>
           		The color of the font in which the text has to appear. The default color value is 
           		&quot;<code>0x000000</code>&quot; (black)
  @@ -977,6 +1032,24 @@
     </section>
   </revision>
   -->
  +
  +<revision release="Development" date="16/04/2004">
  +  <description>
  +    The Image tag library is in development,
  +    changes are fast and furious.
  +  </description>
  +  <section name="New Features">
  +    <item>
  +      New Tag to add transparency to an image.
  +    </item>
  +  </section>
  +  <section name="Bugs Fixed">
  +    <item>
  +      ARGB images are used for PNG and GIF (a typo error fixed)
  +    </item>
  +  </section>  
  +  
  +</revision>
   
   <revision release="Development" date="10/03/2003">
     <description>
  
  
  
  1.3       +155 -151  jakarta-taglibs-sandbox/image/examples/web/WEB-INF/lib/pmiw.jar
  
  	<<Binary file>>
  
  
  1.3       +155 -151  jakarta-taglibs-sandbox/image/lib/pmiw.jar
  
  	<<Binary file>>
  
  
  1.3       +3 -1      jakarta-taglibs-sandbox/image/examples/web/index.jsp
  
  Index: index.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/image/examples/web/index.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.jsp	7 Oct 2003 06:53:46 -0000	1.2
  +++ index.jsp	19 Apr 2004 14:33:19 -0000	1.3
  @@ -26,6 +26,7 @@
           <img:image src="/images/new.gif" >
               <img:rotate degrees="-30" />
               <img:resize scale="80%" />
  +            <img:transparency level="125" />
           </img:image>        
       </img:overlay>
       <img:resize scale="75%" />
  @@ -54,6 +55,7 @@
           &lt;img:image src=&quot;/images/new.gif&quot; &gt;
               &lt;img:rotate degrees=&quot;-30&quot; /&gt;
               &lt;img:resize scale=&quot;80%&quot; /&gt;
  +            &lt;img:transparency level=&quot;125&quot; /&gt;            
           &lt;/img:image&gt;        
       &lt;/img:overlay&gt;
       &lt;img:resize scale=&quot;75%&quot; /&gt;
  @@ -91,7 +93,7 @@
     </tr>
   </table>
   <p align="center">
  -	<b>Source Images used in the above example.</b><br/><br/>
  +	<b>Source Images used in the above example.</b>
   	<img src="/images/splash.jpg" /><br/><br/>
   	<img src="/images/new.gif" />
   </p>
  
  
  
  1.2       +14 -13    jakarta-taglibs-sandbox/image/doc/web/images/splash-new-gray.jpg
  
  	<<Binary file>>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org