Images compress even if they are the same size as the resize paramenters

Images compress even if they are the same size as the resize paramenters

Images compress even if they are the same size as the resize paramenters
divider

(This applies to MX Kollection PRO, Kollection and ADDT as well)

The Kollection > File Upload > Upload and Resize Image server behaviour allows you to specify the image resize dimensions. The script, however, checks to see if the uploaded image is LESS than the specified resize dimensions and, if not, applies the resize and, implicitly, the compression. This needlessly compresses images that are the same size as the resize dimensions specified in the server behaviour and, although it is probably a rarely noticeable bug, it does make images look bad in some cases.

To fix this to the proper behaviour simply open common/lib/image/KT_Image.class.php and around line #242 modify the conditions to less than OR equal in comparisons

if ( $keepProportion && ($newWidth != 0 && $srcWidth<=$newWidth)&& ($newHeight!=0 && $srcHeight<=$newHeight) ) {
Written by:  - 14 Feb, 2011