Detailed Kirby documentation for thumbs?

Hello – indeed infos on the whole thumbs() handling are a bit sparse; a good starting point is the actual source which lists all available parameters. When the function was available as a plugin in Kirby 1, there was a more thorough doc which I can’t find for the moment.

Some notes from the top of my head:

  • if you pass a boolean at the end of the function, it outputs the URL only, like
    thumb($image, array('width' => 960, 'crop' => true, 'quality' => 50), false);
    which is great for generating sources for multiple resolutions (don’t forget to note those in the filename var, or they are only separated via different hashes)
  • There are two replacement plugins (ImageConverter, KirbyText Extension - Image) which offer more elaborate options, like converting sRGB profiles.
  • Then there’s the option of switching from GD to Imagick lib, which some people prefer performace-wise.
  • You can force file formats by setting the extension in
    'filename' => '{safeName}-{hash}.{extension}'
  • Thumb toolkit uses a fork the Simpleimage lib, but doesn’t make use of all of it’s options – with a bit of fiddling, you have access to more filters this way.
2 Likes