Generate thumbnail for image

Hi there,

I try to generate a thumbnail for an image that is selected by a select (image) field of a page.
Afterwards I try to output the URL to the generated thumbnail. But the following code always shows the original image instead of the thumbnail.

<?php $thumb = thumb($p->image($p->mainimage()), array('width' => 270, 'height' => 165))->url(); ?>
<img src="<?php echo $thumb ?>" alt="">

Can you help me to fix this? Or is there any configuration that must be made to make image manipulations work?

1 Like

Didn’t mention, that the target folder isn’t auto-created …
I created the folder /thumbs and now it works …