Forum Moderators: coopster
Am I wrong in thiking that thumb quality translates by
compression?
imagejpeg($thumb, "img/thumbs/t_$filename", 40);
<<< Script excerpt:
$thumb = imagecreatetruecolor($thumb_x,$thumb_y);
//Copy the original image data to it using resampling
imagecopyresampled($thumb, $i ,0, 0, 0, 0, $thumb_x, $thumb_y, imagesx($i), imagesy($i));
//insert in DB thumb's path ####
/*$conn = db_connect();
$sql = "update pics
set path_thumb ='$path_thumb'
where filename='$filename' ";
$result = mysql_query($sql, $conn);
*/
// create and save a thumb ####
imagejpeg($thumb, "img/thumbs/t_$filename", 90);
>>>>
quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default is the default IJG quality value (about 75).
My guess is that the image files are too small to begin with that changing the qualities of the images isn't going to change the image size by any significant amount. If this is correct, then you should expect better optimization with larger image files or a larger difference in quality; instead of 40 and 90, try something like 10 and 100 and the difference should be noticeable.
Anyway, as I don't have much experience with the quality parameter so I really don't know ;)
Original Image: 1.34 MB @ 2136px x 2848px
Now I resized the image with PHP twice, and saved it as two separate files.
Quality 100: 22.2 KB @ 150px x 200px
Quality 40: 2.85KB @ 150px x 200px
[just saw your edit]
Well...glad you got it. I'm going to post these results anyway ;)
[/just saw your edit]