hi:

i followed these instructions:
edited .htaccess
created a preset called thumbs
added a scale action

then put this code

print theme('imagecache', $ruleset_namespace, $image[$filepath]);

in my node.tpl

When i create a new node with cck and imagefield i just get a blank thumbnail with the following address:
http://localhost/drupal/files/imagecache

no files are created in files, nothing happens.

what to do?

Comments

RobRoy’s picture

You probably need to do something like this instead:

print theme('imagecache', 'thumbs', $field_name_of_your_cck_imagefield_field[0]['filepath']);
ezichko’s picture

Nice, now that gives me a correct url but it seems that the thumbnail is not being created.
Here:
http://64.13.213.116/drupal/

The file is uploaded but the image displayed is 640x480 which are "image" settings.

The imagecache thumbnail file is not generated where the filepath points to:
http://64.13.213.116/drupal/files/imagecache/thumbs/files/murloc_0.jpg
I created the folders manually but nothing appears there.

what to do?

dopry’s picture

Did you update the .htaccess file drupal creates in your files directory?

dopry’s picture

nm. you said that in the first section. Can you flush the preset? If the image was already generated it won't create a new one... and double check the preset settings.

sodani’s picture

@ezichko - from the looks of that link, it's working for you.

However, it doesn't seem to be working for me. I've made the changes to the .htaccess file in files. I'm using this code in my contemplate teaser template:

<?php
print theme('imagecache', 'classifieds', $field_image[0]['filepath']);
?>

and I'm getting this outputted:

<img src="http://www.domain.com/files/imagecache/classifieds/files/125072858_76d0b834b0.jpg">

but no image is generated. I see that the folder /files/imagecache has been created, but there's nothing in it.

Any ideas? By the way, I'm using the 4.7 version.

sodani’s picture

I tried to CVS version, and that didn't work either. Just for confirmation, this is what the .htaccess file in /files looks like:

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options FollowSymlinks
<IfModule mod_rewrite.c>
#  RewriteEngine off
</IfModule>

and here's a screenshot of my imagecache admin area:
http://static.flickr.com/103/255934550_a85311e981_o.jpg

sodani’s picture

I figured out what was wrong. Whenever drupal creates a folder on my server, it sets the permissions as 755 (no group or public writing allowed). So the imagecache folder got created, but then nothing could get written to that folder. I simply changed the permissions, and then I was all set.

dopry’s picture

If the web server creates the folder with 755 perms it can write to it.

dopry’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)