Hello,
I try to crop my images: <?= $image->crop(165, 120) ?> but the portrait images remain portrait and don’t get crop. When I want to crop them to square it <?= $image->crop(120) ?> it works fine.
Any idea what I do wrong?
Thanks,
Sven
Hello,
I try to crop my images: <?= $image->crop(165, 120) ?> but the portrait images remain portrait and don’t get crop. When I want to crop them to square it <?= $image->crop(120) ?> it works fine.
Any idea what I do wrong?
Thanks,
Sven
What is your Kirby version. I tested this in a 3.5.1 Starterkit in the photography/trees page with mixed landscape/portrait images, and it works as expected.
Kirby 3.5.0 running on my local macOS with MAMP Pro 6.0.1 and PHP 7.4.9, GD support enabled.
With the Starterkit it works as expected. But when I copy and paste the code to my project the cropping doesn’t work.
Very strange …
Anything particular with your files? And thumb creation does really actually work, apart from the portrait files? I.e. files are created in the media folder with the correct dimensions?
I found the error.
The images where displayed correctly on the page, but it seems that for the cropping the orientation was read in the wrong way, when I set autoOrient to false the cropping works as expected.
Now I rotate the images first in a external program.