I have an overview of subpages where I want to crop the preview image so they all have the same size. I do this by:
<picture> <img srcset="<?php echo $blogpost->blogimage()->toFile()->thumb(['crop' => true, 'width' => 600, 'height' => 380, 'format' => 'webp', 'quality' => 80])->url() ?>" alt=""> </picture>
Most of the times this works in the overview. However some images (mainly square ones) keep their ratio and are not cropping correctly. The names of the files do change to:
image-600x380-crop-1-q80.webp so it seems te be working also because most other images crop correctly. I’m using Imagick on my server (php 8.0) and the newest version of Kirby. What could be the problem here?