You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Robin Wyles (JIRA)" <ji...@apache.org> on 2007/09/14 11:43:32 UTC

[jira] Created: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Addition of "allow-enlarge" parameter to ImageOp resize operation
-----------------------------------------------------------------

                 Key: COCOON-2133
                 URL: https://issues.apache.org/jira/browse/COCOON-2133
             Project: Cocoon
          Issue Type: Improvement
          Components: Blocks: ImageOp
    Affects Versions: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
            Reporter: Robin Wyles
            Priority: Minor
             Fix For: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)


The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 

This new  parameter is declared in the sitemap like so:

<map:read type="imageop" src="image.jpg">
	<map:parameter name="prefix-preserve-ratio" value="true"/>
	<map:parameter name="prefix-allow-enlarge" value="false"/>
	<map:parameter name="prefix-width" value="320"/>
	<map:parameter name="prefix-height" value="240"/>
</map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski updated COCOON-2133:
-----------------------------------------

    Attachment: cocoon-imageop-impl-no-effects-test.patch

Here comes a patch adding very simple test for ImageOp reader.

I have not given both patches too much testing but I hope you will find it helpful.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Commented: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Robin Wyles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555291#action_12555291 ] 

Robin Wyles commented on COCOON-2133:
-------------------------------------

I'd be happy to provide a test-case but I can't see how to set one up to test a Reader. Looking at SitemapComponentTestCase I don't see a corresponding "read" method and I can't find any test-cases for other readers in any other blocks. If you can let me know how I might implement this test-case then I'll write it.

In the meantime I attach a revised patch that fixes a bug with the previous patch where scaling with allowEnlarge property would be ignored when only one dimension needs to be reduced in size.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Robin Wyles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Wyles updated COCOON-2133:
--------------------------------

    Attachment: 4x2.jpg
                cocoon-imageop-impl-resize-operation-and-test.patch 

Grzegorz, thanks for your test case patches!

Attached is patch for "allow-enlarge" parameter along with a suitable test case.

Writing the tests I uncovered some strange behavior with allow-enlarge parameter when used with preserve-ratio. It seems that before my patches the ResizeOperation would fail to enlarge an image at all when preserve-ratio was set to true and only one dimension was supplied. This final patch fixes this issue, using allow-enlarge parameter to control first whether image should be resized and then preserve-ratio to determine final size.

I also include my test image separately as well - for me at least images often seem to corrupt when supplied as part of a patch.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: 4x2.jpg, cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, cocoon-imageop-impl-resize-operation-and-test.patch , ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski updated COCOON-2133:
-----------------------------------------

    Affects version (Component): Parent values: Blocks: ImageOp(10334). Level 1 values: 1.0.0-M1-SNAPSHOT(10335). 
        Fix version (Component): Parent values: Blocks: ImageOp(10336). Level 1 values: 1.0.0-M1-SNAPSHOT(10337). 
              Affects Version/s:     (was: 2.2-dev (Current SVN))
                                     (was: 2.1.11)

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>            Reporter: Robin Wyles
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: 4x2.jpg, cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, cocoon-imageop-impl-resize-operation-and-test.patch , ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski updated COCOON-2133:
-----------------------------------------

    Attachment: cocoon-core-SitemapComponentTestCase-read-method.patch

Having some spare time while waiting for a bus I opened my laptop and created this patch. It adds missing read() method to be used for testing Readers.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: cocoon-core-SitemapComponentTestCase-read-method.patch, ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Closed: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski closed COCOON-2133.
----------------------------------------

    Resolution: Fixed

Patch comitted in r610567.

Thanks Robin for providing test-case! The fact that your improvement is covered by tests moved your patch to the top of my personal patches-to-review-and-apply queue. :)

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>            Reporter: Robin Wyles
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: 4x2.jpg, cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, cocoon-imageop-impl-resize-operation-and-test.patch , ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski updated COCOON-2133:
-----------------------------------------

    Fix Version/s:     (was: 2.1.11)
                       (was: 2.2-dev (Current SVN))

Thanks Robin for providing a patch.

Before it can be applied I would like to see it covered by test-case. Could also attach a test for allow-enlarge parameter?

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: ResizeOperation.patch
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Robin Wyles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Wyles updated COCOON-2133:
--------------------------------

    Attachment: ResizeOperation.patch

Patch to add "allow-enlarge" parameter to imageop resize operation.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>             Fix For: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
>
>         Attachments: ResizeOperation.patch
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Commented: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610660#action_12610660 ] 

Alfred Nathaniel commented on COCOON-2133:
------------------------------------------

Backported to 2.1: http://svn.apache.org/viewvc?rev=674121&view=rev

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>            Reporter: Robin Wyles
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: 4x2.jpg, cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, cocoon-imageop-impl-resize-operation-and-test.patch , ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Updated: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Robin Wyles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Wyles updated COCOON-2133:
--------------------------------

    Attachment: RevisedResizeOperationPatch.txt

Revised patch that fixes a bug with the previous patch where scaling with allowEnlarge property would be ignored when only one dimension needs to be reduced in size.

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Priority: Minor
>         Attachments: ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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


[jira] Assigned: (COCOON-2133) Addition of "allow-enlarge" parameter to ImageOp resize operation

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski reassigned COCOON-2133:
--------------------------------------------

    Assignee: Grzegorz Kossakowski

> Addition of "allow-enlarge" parameter to ImageOp resize operation
> -----------------------------------------------------------------
>
>                 Key: COCOON-2133
>                 URL: https://issues.apache.org/jira/browse/COCOON-2133
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: ImageOp
>    Affects Versions: 2.1.11, 2.2-dev (Current SVN)
>            Reporter: Robin Wyles
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: 4x2.jpg, cocoon-core-SitemapComponentTestCase-read-method.patch, cocoon-imageop-impl-no-effects-test.patch, cocoon-imageop-impl-resize-operation-and-test.patch , ResizeOperation.patch, RevisedResizeOperationPatch.txt
>
>
> The addition of an "allow-enlarge" parameter to the resize operation allows the user to control whether an image should be enlarged by the operation. 
> This new  parameter is declared in the sitemap like so:
> <map:read type="imageop" src="image.jpg">
> 	<map:parameter name="prefix-preserve-ratio" value="true"/>
> 	<map:parameter name="prefix-allow-enlarge" value="false"/>
> 	<map:parameter name="prefix-width" value="320"/>
> 	<map:parameter name="prefix-height" value="240"/>
> </map:read>

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