When source image size exactly matches the requested width it is excluded from the generated output
PickleyD opened this issue · comments
import myImage from 'image.png?w=980;490'
If image.png is 980px wide exactly only the 490px size is included in the generated output, meaning that in my app at screen sizes >980px the small 490px image is displayed. Is this a bug?
If image.png is larger than 980px then the 980px size is generated as I expected.
To work around this issue temporarily I can add the 979px size which is still generated where image.png is 980px exactly:
import myImage from 'image.png?w=980;979;490'
I hit the same issue with vite-imagetools
5.0.4.
I also have the 4.0.12 in another project and I don't recall this issue popping up before, which makes me think it's a new one.
allowUpscale
works (although it's not in the directives documentation), but it's a temporary workaround and this is definitely a bug.
I believe this issue was address. Can you please test again?
This was fixed July 6 in 5.0.5. I'm going to close this as fixed since all the comments are from before that date