Description
Affected version(s)
4.6.13 (I think in all 4.x)
Description
Too small images will be upscaled in frontend which causes an extreme loss of quality
How to reproduce
I have an image with a width of 71px. I make an image size setting with a media query (min-width: 1200px)
and the following settings: width: 200px, Resize mode: Proportional, Pixel densities/scale factors: 1x, 1.5x, 2x (all other settings are empty). If I include the image with the image size, the image will be scaled to the target width of 200px, because there's a scale of 0.355x:
<picture>
<source srcset="files/xxx.jpg 0.355x" media="(min-width: 1200px)">
<img src="files/xxx.jpg" srcset="files/xxx.jpg 0.355x" alt="xxx" itemprop="image">
</picture>
This behavior is not correct, because the image should not be additional upscaled. The upscaling for the retina screen is at least 2x by default and additionally 1/0,355 = 2,817. So the final upscaling of the image will be 2*1/0,355 = 5,633802817.
If I don't use the media query setting and add my settings to the default setting of the image size, the behavior is correct: there's no output of scaling and the image is not bigger than the original size.
So the behavior should be identical and there should be no scaling factor output if the original image is smaller than the target image size.
/cc @ausi