Hello,
when resizing images, they are not correctly resized they got squeezed and look stretched out.
here is the code to be replaced:
com_estateagent/includes/gallery/upload.gallery.php
code to be edited:
| Code: |
if($prop == 1) {
$ratio = $srcWidth / $width;
#$ratio = max($srcWidth, $srcHeight) / $new_size;
$ratio = max($ratio, 1.0);
$destWidth = (int)($srcWidth / $ratio);
$destHeight = (int)($srcHeight / $ratio);
}
else{
$destWidth = (int)($width);
$destHeight = (int)($height);
}
|
to the following:
| Code: |
if($prop == 1) {
$thumb_height = $height;
$thumb_width = $width;
if ($imginfo[0] < $imginfo[1]) // width < height {
$destWidth = intval($thumb_height * ($imginfo[0] / $imginfo[1])) ;
$destHeight = $thumb_height;
} else if ($imginfo[0] > $imginfo[1]) {
$destHeight = intval($thumb_width * ($imginfo[1] / $imginfo[0]));
$destWidth = $thumb_width;
} else {
if ($thumb_width < $thumb_height) {
$destHeight = intval($thumb_width * ($imginfo[1] / $imginfo[0]));
$destWidth = $thumb_width;
} else {
$destWidth = intval($thumb_height * ($imginfo[0] / $imginfo[1])) ;
$destHeight = $thumb_height;
}
}
} else {
$destWidth = (int)($width);
$destHeight = (int)($height);
}
|
hope that helps to someone else or even be implemented in the next release...