Re: Differences in GD2 watermarked images quality in RC2 and RC3
Ok, in case someone finds this later, here's a follow up on this.
I submitted a ticket to Brian and after a few messages and tests, a possible solution was found although it may not fit everyone's shoe.
The way I see it, the problem is that you can't control the quality of the watermarked images. They are always generated with the same quality setting and in some images, the jpeg artifacts are very noticeable.
So I thought we could use the "Original image quality" setting in vBa Gallery -> Modify Settings. This value is used to set the quality of resized images per category.
To try it, open your forum/includes/functions_gallery_imageedit.php, look for the line
@imagejpeg($mainimage, iif($perm, $imglocation, ''), -1);
in funtion watermark_image, and replace it with:
@imagejpeg($mainimage, iif($perm, $imglocation, ''), $catoptions["$imageinfo[catid]"]['gallery_origquality']);
The difference is huge but we'll get to that later.
Regarding this solution, Brian warned that "setting the quality for watermarks to 100 is going to create files about twice the size as the original, which is why -1 has been hardcoded into the script in RC3. Just using the quality setting for original images wouldn't be a good solution for most because if you set the quality to 50 it's first going to change the quality of the original image to 50, then change the quality again when it watermarks the image, so you'd end up with an image with a quality of 25."
On my site, I've set the quality to 90 (or 95). The image size gain is not significant and I do prefer sacrifice space than quality but that's my call. You might prefer the opposite!
To give an example, my test image has 105KB on my disk, but with quality set to 100, it jumps to a whooping 194KB on Gallery.
Setting quality to 95, the size in Gallery is 120KB which I think is a good size/quality ratio.
Be warned, your millage may vary. Make a few tests first.