Answer the question
In order to leave comments, you need to log in
How to compress image quality?
There is a method:
CFile::ResizeImageFile(
$image['tmp_name'],
$tmpImage,
array('width' => $maxW, 'height' => $maxH),
$resizeType,
false,
$quality
);
Answer the question
In order to leave comments, you need to log in
Resize only works when the original width or height changes. If you set the dimensions, but the picture is already smaller than your dimensions, then Resize will not work. That is why quality and other parameters will not be applied.
jpgQuality 50 is already bad. You will get a poor quality picture. And on pictures with a lower resolution, this will be especially noticeable.
I would set the Quality depending on the resolution of the original file.
Some results are more interesting when working with images with a php library.
Example
To compress the quality in your way, get the original size, and substitute it into the parameters minus 1 pixel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question