[magnolia-dev] [JIRA] Updated: (MAGNOLIA-3734) Preview in file upload control does not scale down perfectly square images

2012-12-14 Thread JIRA (on behalf of Milan Divilek)

 [ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-3734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Milan Divilek updated MAGNOLIA-3734:


 Assignee: (was: Philipp Bärfuss)
Fix Version/s: 4.5.8

> Preview in file upload control does not scale down perfectly square images
> --
>
> Key: MAGNOLIA-3734
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3734
> Project: Magnolia
>  Issue Type: Bug
>  Security Level: Public
>  Components: admininterface, gui, templating
>Affects Versions: 4.4.4
>Reporter: Tobias Mattsson
> Fix For: 4.5.8
>
> Attachments: square_image.jpg
>
>
> When the image is perfectly square, like 600x600, its not scaled to fit 
> inside the 150x150 area that the preview should fit into. The code is this, 
> in DialogFile.java:
> {code}
> // resize if to big
> if(imgwidth > imgheight && imgwidth > 150){
> imgheight = (int)(150.0/imgwidth * imgheight);
> imgwidth = 150;
> }
> else if(imgheight > imgwidth && imgheight > 150){
> imgwidth = (int)(150.0/imgheight * imgwidth);
> imgheight = 150;
> }
> {code}
> It should be fixable by changing to:
> {code}
> // resize if to big
> if(imgwidth == imgheight && imgwidth > 150){
> imgwidth = 150;
> imgheight = 150;
> } else if(imgwidth > imgheight && imgwidth > 150){
> imgheight = (int)(150.0/imgwidth * imgheight);
> imgwidth = 150;
> }
> else if(imgheight > imgwidth && imgheight > 150){
> imgwidth = (int)(150.0/imgheight * imgwidth);
> imgheight = 150;
> }
> {code}
> I've attached an image that can be used to demonstrate the problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

   



For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 




[magnolia-dev] [JIRA] Updated: (MAGNOLIA-3734) Preview in file upload control does not scale down perfectly square images

2012-12-20 Thread on behalf of Roman Kovařík

 [ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-3734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roman Kovařík updated MAGNOLIA-3734:


Fix Version/s: 4.4.10
Affects Version/s: 4.5

> Preview in file upload control does not scale down perfectly square images
> --
>
> Key: MAGNOLIA-3734
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3734
> Project: Magnolia
>  Issue Type: Bug
>  Security Level: Public
>  Components: admininterface, gui, templating
>Affects Versions: 4.4.4, 4.5
>Reporter: Tobias Mattsson
>Assignee: Roman Kovařík
> Fix For: 4.4.10, 4.5.8
>
> Attachments: square_image.jpg
>
>
> When the image is perfectly square, like 600x600, its not scaled to fit 
> inside the 150x150 area that the preview should fit into. The code is this, 
> in DialogFile.java:
> {code}
> // resize if to big
> if(imgwidth > imgheight && imgwidth > 150){
> imgheight = (int)(150.0/imgwidth * imgheight);
> imgwidth = 150;
> }
> else if(imgheight > imgwidth && imgheight > 150){
> imgwidth = (int)(150.0/imgheight * imgwidth);
> imgheight = 150;
> }
> {code}
> It should be fixable by changing to:
> {code}
> // resize if to big
> if(imgwidth == imgheight && imgwidth > 150){
> imgwidth = 150;
> imgheight = 150;
> } else if(imgwidth > imgheight && imgwidth > 150){
> imgheight = (int)(150.0/imgwidth * imgheight);
> imgwidth = 150;
> }
> else if(imgheight > imgwidth && imgheight > 150){
> imgwidth = (int)(150.0/imgheight * imgwidth);
> imgheight = 150;
> }
> {code}
> I've attached an image that can be used to demonstrate the problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

   



For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: