[ 
https://issues.apache.org/jira/browse/COCOON-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alfred Nathaniel updated COCOON-2177:
-------------------------------------

    Status: On Hold  (was: Open)

Patch applied to 2.1 and 2.2:

http://svn.apache.org/viewvc?rev=674121&view=rev
http://svn.apache.org/viewvc?rev=674122&view=rev

Please check and close issue.

> ImageOp with requested height & width both zero should be a no-op, instead it 
> throws an exception
> -------------------------------------------------------------------------------------------------
>
>                 Key: COCOON-2177
>                 URL: https://issues.apache.org/jira/browse/COCOON-2177
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.8, 2.1.9, 2.1.10, 2.1.11, 2.1.12-dev (Current SVN), 
> 2.2
>            Reporter: Mark Lundquist
>            Assignee: Alfred Nathaniel
>            Priority: Minor
>
> When the resize height and width are both zero, the resize operation throws:
> java.awt.image.ImagingOpException: Unable to invert transform 
> AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
> Note, if COCOON-2169 is fixed, this happens when no height or width parameter 
> is passed from the sitemap.  In this case, the resize effect should simply 
> pass through the unaltered image... it should be a "no-op".
> The patch is too small to bother attaching, here it is:
> ===================================================================
> --- 
> blocks/cocoon-imageop/cocoon-imageop-impl/src/main/java/org/apache/cocoon/reading/imageop/ResizeOperation.java
>     (revision 635771)
> +++ 
> blocks/cocoon-imageop/cocoon-imageop-impl/src/main/java/org/apache/cocoon/reading/imageop/ResizeOperation.java
>     (working copy)
> @@ -57,6 +57,9 @@
>          if( ! enabled ) {
>              return image;
>          }
> +        if ( this.width == 0 && this.height == 0 ) {
> +            return image;
> +        }
>          double height = image.getHeight();
>          double width = image.getWidth();
>          double xScale = this.width / width

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to