Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
4.4.4, 4.5
-
None
Description
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:
// 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; }
It should be fixable by changing to:
// 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; }
I've attached an image that can be used to demonstrate the problem.
Checklists
Acceptance criteria