[opencms-dev] can opencms store pictures in diff sizes

Jorge González informatico at hotelparadisepark.com
Fri May 6 10:44:33 CEST 2005


Here goes a code example...

0) deploy the image taglib example war on tomcat and try it. Does it work ?

If it works...

1) change your ??/opencms/WEB-INF/web.xml and add this after the last
'taglib' tag
----
    <taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/image-1.0</taglib-uri>
        <taglib-location>/WEB-INF/taglibs/taglibs-image.tld</taglib-location
>
    </taglib>
----

2) declare for use in the JSP

----
<%@ taglib prefix="img" uri="http://jakarta.apache.org/taglibs/image-1.0" %>
----

3) Use it  (this code generates a 200x200 thumbnail in the "generated/"
folder)

----
	<img:image
		display="true"
		refresh="true"
		src="<%=cmsbean.link(bigThumb)%>"
		name="<%="200x200_test_image"
		dir="generated"
		attributes="">
		<img:resize width="200" height="200"/>
	</img:image>
----

I hope that it helps.

Jorge.




More information about the opencms-dev mailing list