imageutil
Overview
the imageutil resource allows to edit the resource-configuration of an image resource-type. it gives you a web gui for resize, crop, and watermark. and also a simple gui for editing the other resource-conifuguration properties of the image resource-type.
- Name:
- imageutil
- Namespace:
- http://www.litwan.com/yanel/resource/1.0
- Universal Name:
- <{http://www.litwan.com/yanel/resource/1.0}imageutil/>
- Description:
- configure tool for image resource
- Java Class:
- com.litwan.yanel.impl.resources.image.ImageUtilResource
IMPORTANT
this resource depends on the image resource.
Resource Configuration
- matcher-extension
- path extension which needs to be removed from the path to get the repo path. e.g. for the following matcher <matcher pattern="**.imageutil.html" rcpath="/usecases/imageutil.html.yanel-rc"/> the configured matcher-extension would be ".imageutil.html"
Request Paramter
- preserve-alpha
- background-color
- allow-request-parameter
- prohibit-up-scale
- disable-cache
- cache-root-path
- yanel-path
- watermark-transparency
- dragtop
- dragleft
- watermark-path
- resizeheight
- resizewidth
- y2
- x2
- y1
- x1
- rotate
- addrotate
- edit-path
- yanel.resource.imageutil.crop.save
- yanel.resource.imageutil.rotate.save
- yanel.resource.imageutil.resize.save
- yanel.resource.imageutil.watermark.save
- yanel.resource.imageutil.more.save
- yanel.resource.imageutil.watermark.supress
- yanel.resource.imageutil.create.path
- yanel.resource.imageutil.create.filename
- yanel.resource.imageutil.create.save
- continue-path
Basic Example:
To use the image resource type first you need to register the resource type as usual. add following line with the correct path to your (local.)resource-types.xml
<resource-type src="/home/simon/src/3k3-yanel-contrib/resource-types/imageutil/" compile="true"/>
after this you need to add a matcher to the map.rc-map file e.g.
<matcher pattern="**.imageutil.html" rcpath="/usecases/imageutil.html.yanel-rc"/>
then you need to create an imageutil.html.yanel-rc file with following content.
<?xml version="1.0"?>
<yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
<yanel:rti name="imageutil" namespace="http://www.litwan.com/yanel/resource/1.0"/>
<yanel:property name="matcher-extension" value=".imageutil.html"/>
<yanel:custom-config>
<views>
<view id="default" type="jelly">
<template>rthtdocs:/jelly/imageutil.jelly</template>
<mime-type>text/html</mime-type>
<xslt>/xslt/global.xsl</xslt>
</view>
<view id="create" type="jelly">
<template>rthtdocs:/jelly/create.jelly</template>
<mime-type>text/html</mime-type>
<xslt>/xslt/global.xsl</xslt>
</view>
</views>
</yanel:custom-config>
</yanel:resource-config>
now if you have an image on http://localhost:8080/3k3-resource-type-demo/images/seilbahn.jpg you can edit it under http://localhost:8080/3k3-resource-type-demo/images/seilbahn.jpg.imageutil.html
release log
date version details 18.01.2011 1.0 first release
todo
- catch errors more gracefully
IMPORTANT
if you use this resource-type in a headless environement set Djava.awt.headless=true
Demo
http://demo.yanel-contribution.3k3.org/images/seilbahn.jpg.imageutil.html
Source
browse svn repo: http://trac.yanel-contribution.3k3.org/browser/resource-types/imageutil
checkout source:
svn co https://svn.3k3.org/repos/public/yanel/resource-types/imageutil
License
Related Links
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5106305 dpi bug in imageIO
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5105068 dpi bug in imageIO
- http://stackoverflow.com/questions/244164/resize-an-image-in-java-any-open-source-library/244177#244177
- http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)