You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.
My issue is - I'm using it not only to cut to size, but also to save on bandwidth.
I ran the function on several images for several preset sizes.
In some cases, the output is the same dimension as the original, but the output size was x3 - x4 the size.
(e.g. - real example: original 59kb; output 198kb . See attachments below.)
The compression needs to be improved.
Thanks!
original:
resized:
The text was updated successfully, but these errors were encountered:
The functions near the end of the script , imagejpeg and imagepng , also accept a third parameter for quality. Imagejpeg defaults to 75%, where you can set it to 100. imagepng is on a scale of 0-9 where 0 is no compression.
example on line 86:
switch ( $info[2] ) {
case IMAGETYPE_GIF: imagegif($image_resized, $output); break;
case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, 100); break;
case IMAGETYPE_PNG: imagepng($image_resized, $output, 0); break;
default: return false;
}
All in all, it's a very handy script.
My issue is - I'm using it not only to cut to size, but also to save on bandwidth.
I ran the function on several images for several preset sizes.
In some cases, the output is the same dimension as the original, but the output size was x3 - x4 the size.
(e.g. - real example: original 59kb; output 198kb . See attachments below.)
The compression needs to be improved.
Thanks!
original:
resized:
The text was updated successfully, but these errors were encountered: