From: <mol...@us...> - 2009-10-16 09:52:46
|
Revision: 1492 http://openutils.svn.sourceforge.net/openutils/?rev=1492&view=rev Author: molaschi Date: 2009-10-16 09:52:37 +0000 (Fri, 16 Oct 2009) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlmedia-4.0-b10 Added Paths: ----------- tags/openutils-mgnlmedia-4.0-b10/ tags/openutils-mgnlmedia-4.0-b10/pom.xml tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java Removed Paths: ------------- tags/openutils-mgnlmedia-4.0-b10/pom.xml tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java Property changes on: tags/openutils-mgnlmedia-4.0-b10 ___________________________________________________________________ Added: svn:ignore + .settings .checkstyle .classpath .project target test-output temp-testng-customsuite.xml Added: svnmerge-integrated + /branches/openutils-mgnlmedia-3.6.x:1-982,1004 Added: svn:mergeinfo + /branches/openutils-mgnlmedia-3.6.x:1004 Deleted: tags/openutils-mgnlmedia-4.0-b10/pom.xml =================================================================== --- trunk/openutils-mgnlmedia/pom.xml 2009-10-16 09:46:56 UTC (rev 1489) +++ tags/openutils-mgnlmedia-4.0-b10/pom.xml 2009-10-16 09:52:37 UTC (rev 1492) @@ -1,160 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-parent</artifactId> - <version>1.1</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlmedia</artifactId> - <name>Magnolia SimpleMedia Module</name> - <description>Magnolia SimpleMedia Module: a module for Magnolia CMS for easier management of images and videos with - several features.</description> - <version>4.0-b10-SNAPSHOT</version> - <inceptionYear>2008</inceptionYear> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <url>http://lab.openmindonline.it/lab/products/media.html</url> - <issueManagement> - <system>jira</system> - <url>http://lab.openmindonline.it/jira/browse/MEDIA</url> - </issueManagement> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - <plugins> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <id>bundle</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - <configuration> - <descriptors> - <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> - </descriptors> - </configuration> - </plugin> - <plugin> - <groupId>com.google.code.maven-license-plugin</groupId> - <artifactId>maven-license-plugin</artifactId> - <version>1.4.0</version> - <configuration> - <header>src/main/etc/header.txt</header> - <includes> - <include>src/**</include> - </includes> - <excludes> - <exclude>target/**</exclude> - <exclude>src/site/**</exclude> - <exclude>src/main/bundle/**</exclude> - <exclude>src/main/resources/**/*.ftl</exclude> - <exclude>src/main/assembly/**</exclude> - <exclude>src/main/resources/mgnl-bootstrap/**</exclude> - <exclude>src/main/resources/mgnl-nodetypes/**</exclude> - <exclude>src/main/resources/mgnl-resources/media/css/multibox.css</exclude> - <exclude>src/main/resources/mgnl-resources/media/js/multibox/**</exclude> - <exclude>src/main/resources/mgnl-resources/media/js/miframe.js</exclude> - <exclude>src/main/resources/mgnl-resources/media/js/moo*.*</exclude> - <exclude>src/main/resources/mgnl-resources/media/js/swfobject.js</exclude> - </excludes> - <properties> - <year>${project.inceptionYear} - 2009</year> - <name>${project.name}</name> - <description>${project.description}</description> - <url>${project.url}</url> - </properties> - </configuration> - <executions> - <execution> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - <reporting> - <plugins> - <plugin> - <groupId>net.sourceforge.maven-taglib</groupId> - <artifactId>maven-taglib-plugin</artifactId> - </plugin> - </plugins> - </reporting> - <dependencies> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>4.0.1</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>4.0.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-mgnltasks</artifactId> - <version>4.0</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-mgnlext</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-elfunctions</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>com.drewnoakes</groupId> - <artifactId>metadata-extractor</artifactId> - <version>2.4.0-beta-1</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - <version>2.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-mgnlmedia-4.0-b10/pom.xml (from rev 1491, trunk/openutils-mgnlmedia/pom.xml) =================================================================== --- tags/openutils-mgnlmedia-4.0-b10/pom.xml (rev 0) +++ tags/openutils-mgnlmedia-4.0-b10/pom.xml 2009-10-16 09:52:37 UTC (rev 1492) @@ -0,0 +1,166 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-parent</artifactId> + <version>1.1</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlmedia</artifactId> + <name>Magnolia SimpleMedia Module</name> + <description>Magnolia SimpleMedia Module: a module for Magnolia CMS for easier management of images and videos with + several features.</description> + <version>4.0-b10</version> + <inceptionYear>2008</inceptionYear> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <url>http://lab.openmindonline.it/lab/products/media.html</url> + <issueManagement> + <system>jira</system> + <url>http://lab.openmindonline.it/jira/browse/MEDIA</url> + </issueManagement> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>bundle</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> + </descriptors> + </configuration> + </plugin> + <plugin> + <groupId>com.google.code.maven-license-plugin</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>1.4.0</version> + <configuration> + <header>src/main/etc/header.txt</header> + <includes> + <include>src/**</include> + </includes> + <excludes> + <exclude>target/**</exclude> + <exclude>src/site/**</exclude> + <exclude>src/main/bundle/**</exclude> + <exclude>src/main/resources/**/*.ftl</exclude> + <exclude>src/main/assembly/**</exclude> + <exclude>src/main/resources/mgnl-bootstrap/**</exclude> + <exclude>src/main/resources/mgnl-nodetypes/**</exclude> + <exclude>src/main/resources/mgnl-resources/media/css/multibox.css</exclude> + <exclude>src/main/resources/mgnl-resources/media/js/multibox/**</exclude> + <exclude>src/main/resources/mgnl-resources/media/js/miframe.js</exclude> + <exclude>src/main/resources/mgnl-resources/media/js/moo*.*</exclude> + <exclude>src/main/resources/mgnl-resources/media/js/swfobject.js</exclude> + </excludes> + <properties> + <year>${project.inceptionYear} - 2009</year> + <name>${project.name}</name> + <description>${project.description}</description> + <url>${project.url}</url> + </properties> + </configuration> + <executions> + <execution> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + <plugin> + <groupId>net.sourceforge.maven-taglib</groupId> + <artifactId>maven-taglib-plugin</artifactId> + </plugin> + </plugins> + </reporting> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>4.0.1</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>4.0.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnltasks</artifactId> + <version>4.0</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlext</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-elfunctions</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>com.drewnoakes</groupId> + <artifactId>metadata-extractor</artifactId> + <version>2.4.0-beta-1</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-4.0-b10</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmedia-4.0-b10</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmedia-4.0-b10</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java 2009-10-16 09:46:56 UTC (rev 1489) +++ tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java 2009-10-16 09:52:37 UTC (rev 1492) @@ -1,68 +0,0 @@ -package net.sourceforge.openutils.mgnlmedia.media.processors; - -import java.awt.Color; -import java.awt.image.BufferedImage; -import java.util.Map; - -import net.sourceforge.openutils.mgnlmedia.media.utils.ImageUtils; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.NumberUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * Generate rounded corners on images.<br/> - * Activated by declaring the parameter <strong>roundcorners</strong>; its value can be: - * <ul> - * <li>no value or true: processor draws roundcorners with 5px radius</li> - * <li>int value: processor draws roundcorners with passed radius</li> - * </ul> - * If the "background" parameter is specified (hex color), it will be applied when rounding corners.<br/> - * If no "background" parameter is found, if the image format is png a transparent background is applied else a white background is applied. - * @author molaschi - * @version $Id: $ - */ -public class RoundedCornersProcessor implements ImagePostProcessor -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(RoundedCornersProcessor.class); - - /** - * {@inheritDoc} - */ - public BufferedImage processImage(BufferedImage image, int x, int y, Map<String, String> parameters) - { - String roundCorners = parameters.get("roundcorners"); - if (StringUtils.isNotBlank(roundCorners)) - { - int radius = 5; - if (!"true".equals(roundCorners)) - { - radius = NumberUtils.toInt(roundCorners); - } - - Color backgroundColor = null; - String hexColor = parameters.get("background"); - if (StringUtils.isNotBlank(hexColor)) - { - try - { - hexColor = "0x" + (hexColor.startsWith("#") ? hexColor.substring(1) : hexColor); - backgroundColor = Color.decode(hexColor); - } - catch (NumberFormatException e) - { - log.error("Invalid color code: " + hexColor, e); - } - } - return ImageUtils.addRoundedCorners(image, backgroundColor, radius); - } - return image; - } - -} Copied: tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java (from rev 1490, trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java) =================================================================== --- tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java (rev 0) +++ tags/openutils-mgnlmedia-4.0-b10/src/main/java/net/sourceforge/openutils/mgnlmedia/media/processors/RoundedCornersProcessor.java 2009-10-16 09:52:37 UTC (rev 1492) @@ -0,0 +1,93 @@ +/** + * + * Magnolia SimpleMedia Module (http://lab.openmindonline.it/lab/products/media.html) + * Magnolia SimpleMedia Module: a module for Magnolia CMS for easier management of images and videos with + * several features. + * Copyright (C)2008 - 2009, Openmind S.r.l. http://www.openmindonline.it + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package net.sourceforge.openutils.mgnlmedia.media.processors; + +import java.awt.Color; +import java.awt.image.BufferedImage; +import java.util.Map; + +import net.sourceforge.openutils.mgnlmedia.media.utils.ImageUtils; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * Generate rounded corners on images.<br/> + * Activated by declaring the parameter <strong>roundcorners</strong>; its value can be: + * <ul> + * <li>no value or true: processor draws roundcorners with 5px radius</li> + * <li>int value: processor draws roundcorners with passed radius</li> + * </ul> + * If the "background" parameter is specified (hex color), it will be applied when rounding corners.<br/> + * If no "background" parameter is found, if the image format is png a transparent background is applied else a white background is applied. + * @author molaschi + * @version $Id: $ + */ +public class RoundedCornersProcessor implements ImagePostProcessor +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(RoundedCornersProcessor.class); + + /** + * {@inheritDoc} + */ + public BufferedImage processImage(BufferedImage image, int x, int y, Map<String, String> parameters) + { + String roundCorners = parameters.get("roundcorners"); + if (StringUtils.isNotBlank(roundCorners)) + { + int radius = 5; + if (!"true".equals(roundCorners)) + { + radius = NumberUtils.toInt(roundCorners); + } + + Color backgroundColor = null; + String hexColor = parameters.get("background"); + if (StringUtils.isNotBlank(hexColor)) + { + try + { + hexColor = "0x" + (hexColor.startsWith("#") ? hexColor.substring(1) : hexColor); + backgroundColor = Color.decode(hexColor); + } + catch (NumberFormatException e) + { + log.error("Invalid color code: " + hexColor, e); + } + } + return ImageUtils.addRoundedCorners(image, backgroundColor, radius); + } + return image; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |