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
If I upload an png image it becomes more then 4x the original size, you can't use the quality 0 - 100 on png images, but you can convert it using this code
// *** Scale quality from 0-100 to 0-9
$scaleQuality = round(($quality / 100) * 9);
// *** Invert quality setting as 0 is best, not 9
$invertScaleQuality = 9 - $scaleQuality;
the intire function:
switch (strtolower($pathinfo['extension'])) {
case 'gif':
$createHandler = 'imagecreatefromgif';
$outputHandler = 'imagegif';
$quality = null;
break;
case 'jpg':
case 'jpeg':
$createHandler = 'imagecreatefromjpeg';
$outputHandler = 'imagejpeg';
break;
case 'png':
$createHandler = 'imagecreatefrompng';
$outputHandler = 'imagepng';
// *** Scale quality from 0-100 to 0-9
$scaleQuality = round(($quality / 100) * 9);
// *** Invert quality setting as 0 is best, not 9
$invertScaleQuality = 9 - $scaleQuality;
$quality = $invertScaleQuality;
break;
default:
return false;
}
The text was updated successfully, but these errors were encountered:
If I upload an png image it becomes more then 4x the original size, you can't use the quality 0 - 100 on png images, but you can convert it using this code
the intire function:
The text was updated successfully, but these errors were encountered: