This PR basically improves the logic for scaling down jpg images.
Now it checks instead by width or height, by matrix size, making better scaling down for any kind of image aspect ratio.
I have checked the documentation of libjpeg-turbo and they mention this:
unsigned int scale_num, scale_denom
Scale the image by the fraction scale_num/scale_denom. Default is
1/1, or no scaling. Currently, the only supported scaling ratios
are M/8 with all M from 1 to 16, or any reduced fraction thereof (such
as 1/2, 3/4, etc.) (The library design allows for arbitrary
scaling ratios but this is not likely to be implemented any time soon.)
Smaller scaling ratios permit significantly faster decoding since
fewer pixels need be processed and a simpler IDCT method can be used.
I have done some tests and the library admit any value of scale_denom greater than 1, maybe documentation is outdated
Description
This PR basically improves the logic for scaling down jpg images. Now it checks instead by width or height, by matrix size, making better scaling down for any kind of image aspect ratio.
I have checked the documentation of
libjpeg-turbo
and they mention this:I have done some tests and the library admit any value of
scale_denom
greater than 1, maybe documentation is outdatedThanks