Problem with crop() method

When i call <?= $event->image() ?> every image is getting properly displayed. However once i add the crop, exactly following the Youtube instructions from the official kirby channel, i get the error as seen in attachment.

Since i used the same line on another suppage where everything worked fine, im a bit confused now. Can anyone help?

You can try as follows:

<?php if ($eventImage = $event->image()): ?>
    <img src="<?php echo $eventImage->crop(400, 300)->url(); ?>">
<?php endif; ?>
1 Like

this puts out another error

I just fixed the code above.


this worked well! thank you so much :slight_smile: