Question

I am having trouble getting imagecache to generate a thumbnail based on a preset I have created named 'thumbnail'. I have an cck image_field and a custom node view. The code I am using to output my images is:

<?php foreach($node->field_comm_gallery as $galleryItem) { ?>
    <?php print theme('imagecache', 'thumbnail', $galleryItem['filepath'], $alt = '', ''); ?>
<?php } ?>

The output I get from the following is:

<img class="imagecache imagecache-thumbnail" title="" alt="" src="http://127.0.0.1/sites/default/files/imagecache/thumbnail/cedimages/3388564188_4427beac12_b_0.jpg"/>

<img class="imagecache imagecache-thumbnail" title="" alt="" src="http://127.0.0.1/sites/default/files/imagecache/thumbnail/cedimages/3388564188_4427beac12_b_2.jpg"/>

Everything looks correct but those files do not exist in that folder.

My question: Is the print theme(..) call supposed to generate the thumbnail on the fly when it is called, or is the thumbnail generated when a node is created/updated?

I am using the GD Image processer and receive no errors.

Was it helpful?

Solution 2

Thanks for the help. It actually turned out to be this bug (http://drupal.org/node/540486#comment-2356560)

I had to remove the & from the function parameters in imageapi.module

function imageapi_gd_image_resize(&$image, $width, $height)

No clue why, but it seems to break when using php 5.x

OTHER TIPS

The node field value has within it the display value already generated. So using theme function is not needed. But the file should be created regardless. It looks like the problem is the permission to either Drupals temp folder or the files folder. Take a look at those in the files settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top