Sets your own handler for where to store thumbnails

Default value


By default all thumbnails will be stored in the thumbs folder. For the directory path, the path of the parent page will be used. The thumb driver automatically converts all thumbnail parameters to a human-readable filename for thumbnails.


c::set('thumbs.destination', function($thumb) {
  return new Obj([
    'root' => '/var/www/' . $thumb->source->filename(),
    'url'  => '' . $thumb->source->filename()

The destination callback must return an Obj (Object) with root and url, so the thumb generator can figure out where to store the thumbnail and what the URL for it will be.

Is something missing or incorrect? Edit this page on Github…