Dear forum
Background
I am following Bastian’s tutorial on building a Kirby site on YouTube, but I’ve come stuck when he shows how to crop images: https://youtu.be/op5iP71Bg6w?feature=shared&t=653
PHP Version => 8.4.12
Kirby Version 5.0.4 with plain kit
Error
The images shows just fine when I just use <?= $item->image() ?>
but with the crop added <?= $item->image()->crop(400) ?>
, they are “not found” / not generated in the media folder.
My current home.php, where I want to show the pages/images
<?php snippet('header') ?>
<main class="main">
<h1><?= $page->title() ?></h1>
<?= $page->text() ?>
<ul>
<?php foreach ($page->children()->listed() as $item): ?>
<li>
<a href="<?= $item->url() ?>">
<figure>
<?= $item->image()->crop(400) ?>
<figcaption><?= $item->title() ?></figcaption>
</figure>
</a>
</li>
<?php endforeach ?>
</ul>
</main>
<?php snippet('footer') ?>
Bastian’s code
The only exception is that I am not naming it projects but items instead, and placing it on /home.
Preview of my site
Hovering the src url says “Could not load the image”
Attempted solutions
Check that gd is installed
Herd lists gd as installed per default: PHP Extensions - Laravel Herd
php -i
gives me the following result on the local server as well:
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.13.2
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.6.51.git
WBMP Support => enabled
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
TGA Read Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => On => On
Check read/write access to media folder
Kirby is able to create new folders in /media. For this particular issue I’ve found a .json file for each attempted crop image:
media/pages/home/100arsensomhed/ce001b2f58-1757739217/.jobs/2025-07-31_100rsensomhed-cover_result-400x-crop.jpg.json
{"width":400,"height":null,"quality":null,"crop":"center","filename":"2025-07-31_100rsensomhed-cover_result.jpg"}
Install imagemagick
Installed on my local machine through Homebrew. convert -v
returns Version: ImageMagick 7.1.2-3 Q16-HDRI aarch64 23340 ``https://imagemagick.org
Enabled Kirby debugger
It shows nothing.
Checked Herd log
Not much here, except a seemingly unrelated error:
2025/09/15 08:54:21 [error] 41960#2249304: *189 FastCGI sent in stderr: "PHP message: Whoops\Exception\ErrorException: Function finfo_close() is deprecated since 8.5, as finfo objects are freed automatically in /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Filesystem/Mime.php:191
Stack trace:
#0 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Filesystem/Mime.php(191): Whoops\Run->handleError(8192, 'Function finfo_...', '/Users/emr/Docu...', 191)
#1 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Filesystem/Mime.php(324): Kirby\Filesystem\Mime::fromFileInfo('/Users/emr/Docu...')
#2 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Filesystem/File.php(358): Kirby\Filesystem\Mime::type('/Users/emr/Docu...')
#3 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Image/Image.php(80): Kirby\Filesystem\File->mime()
#4 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Image/Image.php(231): Kirby\Image\Image->dimensions()
#5 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/src/Image/Darkroom.php(116): Kirby\Image\Image->width()
#6 /Users/emr/Documents/Sites/kirby/rdgdc/kirby/config" while reading response header from upstream, client: 127.0.0.1, server: rdgdc.test, request: "GET /media/pages/home/test1/aa9e817b07-1757595135/13cb3fba7aa39f94e4c489c0d7513bf7-400x-crop.jpg HTTP/1.1", upstream: "fastcgi://unix:/Users/emr/Library/Application Support/Herd/herd85.sock:", host: "rdgdc.test", referrer: "http://rdgdc.test/?herd=preview"
Disabling stylesheets
I don’t have any styles applied, only a small css reset that I’ve disabled.
Changing php version
Changing to php 8.5 in Herd makes no difference.
Images from another source
I tried placing smaller images from other sources, but it makes no difference either. Still .jpg though.
Testing with starter kit
The same images load fine as cropped when running another site with the starter kit.
Converting source images
Attempted to resize source images manually before placing in content folder. Also attempted converting from jpg to webp.
Since I’m quite inexperienced, my guess is that the error is quite simple and related to the php code–but I’ve double checked that my code matches Bastian’s example, so now I need a tiny bit of help.