building my first Kirby project and stumbled upon a strange behavior: When I set width, height and crop the images are beeing upscaled. Is there any way to prevent this?
There is an upscale option for exactly that and it is set to false by default. So if it doesn’t work, then that’s a bug. I will look into this tomorrow.
I have tested this and this is not a bug, it’s intended behavior:
The upscale option worked for me for the resize operation, but not for the crop operation. The reason is that resizing an image always keeps the aspect ratio, so if you don’t upscale a small image, it doesn’t matter because the aspect ratio of the small image and the upscaled image would be the same. This is why Kirby doesn’t upscale in this case.
Cropping however is more difficult as it changes the aspect ratio, so upscaling is required to reach exactly the intended size and aspect ratio (I made a temporary fix and even pushed it already but then deleted it because the result was always a few pixels off).
We might reconsider this for a future release, but for now you should resize the images only if you don’t want upscaling.
@lukasbestle I worked too long with TYPO3 but they got a global setting “do not upscale” and when you set a crop on an image it only touches the image if it is too big (either width or height).
For my case, I let it rest because it is a very small site and in the future, images will be much bigger (old data from the old website caused this problem).
That might be a temporary fix but please note that (as I wrote above) not cropping the image at all will lead to layout issues as the images won’t have the expected aspect ratio.