I checked and seems no one has mentioned this, so I will. the thumbnails created by the MCPUK filemanager are great, UNLESS the image is a small one, in which case it blows it up!
Here is a fix:
In helpers/Thumbnails.php
Find about line 212
if ($width>$height) { $n_height=$height*(96/$width); $n_width=96; } else { $n_width=$width*(96/$height); $n_height=96; }
Right after that INSERT the followint two lines which will KEEP the sizing on smaller images:
if (($width > $height) && ($width < 96)) {$n_width=$width; $n_height=$height; }
if (($height > $width) && ($height < 96)) {$n_width=$width; $n_height=$height; }
That will allow the browser to show the images smaller than 96x96 just as they are!
Here is a fix:
In helpers/Thumbnails.php
Find about line 212
if ($width>$height) { $n_height=$height*(96/$width); $n_width=96; } else { $n_width=$width*(96/$height); $n_height=96; }
Right after that INSERT the followint two lines which will KEEP the sizing on smaller images:
if (($width > $height) && ($width < 96)) {$n_width=$width; $n_height=$height; }
if (($height > $width) && ($height < 96)) {$n_width=$width; $n_height=$height; }
That will allow the browser to show the images smaller than 96x96 just as they are!
RE: MCPUK Small Image Thumbnail Resizing
$thumbsize = 96;
if ($width > $thumbsize || $height > $thumbsize) {
$n_height = (int) ($height > $width) ? $thumbsize : $thumbsize * $height / $width;
$n_width = (int) ($width > $height) ? $thumbsize : $thumbsize * $width / $height;
}
else {
$n_height = $height;
$n_width = $width;
}
The above also facilitates putting the thumbnail size in the configuration instead of hard coding the value.
Cheers, Tommy Ipsen