Thumb creation not working, no error

Hi there,

I’m trying to make use of the thumb() function within a tag file, but it won’t generate any thumbs. Instead it still refers to the original (png) image files. Unfortunately I also cannot find any error message in the logs of my linux machine (running apache2).

The regarding code snippet:

foreach ($images as $image) {
            $output .= '<a href="' . $image->url() . '" title="' . $image->title() . '" data-dialog="">'
                    . '<img src="' . thumb($image, array('width' => 100, 'crop' => true, 'quality' => 80))->url() . '" alt="' . $image->title() . '" />'
                    . '</a>';

Any suggestions how to proceed here?

Thanks in advance!

Can you generate thumbs outside of the Kirbytag, e.g. through code in your template? Or does the panel create thumbs?

If you can’t create thumbs at all, please check whether the thumbs folder exists and is writable by your web server.

Nope, nothing happens in the template neither. Again, no error messages in the apache log.

Panel doesn’t create thumbnails neither. I’m running kirby 2.1.0.

Sorry, I forgot to mention, I created a thumbs folder which is writable for the webserver as well.

Is the GD Library enabled?

If the thumb generation fails, there is usually no error message. The reason why it might fail, can be several:

  • /thumbs folder missing or not writable or wrong permissions
  • GD Library missing or not working properly
  • Images too big (i.e. > 2000 px width), will fail, you will have to enable ImageMagick to create thumbs for such images
1 Like

I installed imagemagick and changed the driver setting in kirby. Now it works fine.
I guess there has been a problem with the libgd configuration or it hasn’t been installed at all.

Still I find, I should get an error message from kirby, if the driver is not found.

Thanks a lot for your help!