Image must be a gd resource - admin panel

Hi there,
Started working with Kirby and it’s quite a lot of fun.
Also, I’ve started working with a color Extractor plugin and I’m facing an issue.
As soon as I update an image to my admin panel, it tells me that the image must be a gd resource.
I don’t really know what to do in order to make it a gd ressource?

May I ask for some help?

1 Like

Do thumbs work in your installation? Is the GD extension enabled?

There is already an issue in the repo, but without any comments

I saw that issue, but it’s not quite kindly asked haha.
I tried

'thumbs' => [
 'driver' => 'im'

and it gives me another error. So I guess Thumbs works ?
I also activated the GD extension in my php.ini

Hi @paubou, what I meant is if thumbs get actually created in the media folder. Kirby first creates .json job files, and then depending when the url of a file is called, the actual thumbs are created. The default thumbs driver used (when nothing is set in your config file), is the GD library.

Since the Panel automatically creates some thumbs when you upload to a section, I’d like to know if you can actually see thumbs being created in the media folder in the given page. In a starterkit, you should then for example see something like this:

I.e. a jobs folder with the different jobs of the should-be-created-when-called file sizes, and some actually created thumbs when these were actually called.

Hi @texnixe thanks for the reply.
Actually, I get .json files created in the correct path.
I’ve also read through the documention and noticed it was the GD library that was used by default.
by default, they contain those informations:
exactly as in the starterkit.

Thanks for the help.

Yes, but if the json files are present, that doesn’t mean that the thumbs are actually created. So if you get the json files but don’t actually see any thumbs like in the screenshot, then something is not working as expected.

First, remove your thumb driver setting from config, so that we get GD library as default, and get this to work. Note that if you make changes to php.ini, you have to restart your server to apply the changes.

Actually I didn’t use im as a thumb driver setting, it was an exemple.
In my config.php, I have nothing that changes the default GD library.
Sorry the exemple I picked might have been a bit confusing…
Here is a picture of what’s inside my media folder.


So, I checked my php.ini that contains the extension=gd uncommented.
I also checked my php modules in my command prompt, and gd is one of them.
So, I don’t really know what is wrong there…

Hm, the thumbs are properly generated it seems.

I quickly tested the plugin in my local installation and couldn’t reproduce your issue. So I don’t really know what the issue could be.

Ping @sylvainjule.

Yeah, I tested the plugin in the starterkit installation too, but it doesn’t seem to work either.

Fixed it:
The plugin doesn’t seem to be compatible with PHP8.0
made it work using php7.4
thanks @texnine :slight_smile: