Re: [ADDON] Resize attached images
Reply #2 –
There are a couple of things here. First it has nothing to do with the addon
PART 1
In SMF the default JPG compression used by GD/GD2 was not set, which means it used the default quality of 75. 75 is to aggressive, you start to loose to much information at that level. As such Elk changed (set) that value 80, which you could still argue is hair to aggressive, but that's what I picked at the time.
So SMF may compress an image more, but at the expense of quality, and since these days no one is uploading 640x480 images quality becomes more interesting.
PART 2
In Elk, we also utilize Imagick, over GDx, when its available. In honor of not setting proper defaults, we did not set any quality level for JPG compression when using Imagick ... It defaults to 87 (AFAIK), so much larger images than SMF at 75 and large than ELK w/o Imagick support. This is a bug which should be fixed in 1.0.7 / 1.1
In Graphics.subs.php find
// Set the input and output image size
$src_width = empty($src_width) ? $imagick->getImageWidth() : $src_width;
$src_height = empty($src_height) ? $imagick->getImageHeight() : $src_height;
$dest_width = empty($max_width) ? $src_width : $max_width;
$dest_height = empty($max_height) ? $src_height : $max_height;
and add after that
// Set jpeg image quality to 80
if ($default_formats[$preferred_format] === 'jpeg')
{
$imagick->setImageCompression(Imagick::COMPRESSION_JPEG);
$imagick->setImageCompressionQuality(80);
}
Please add that and then try your test again and let us know how it works.