How to get the path to an image with applied ImageCache preset?

Events happening in the community are now at Drupal community events on www.drupal.org.
kirilius's picture

I am using Imagefield + ImageCache combination. Using code like this:

print theme('imagecache', 'preset1', $field_pictures[$image_index]['filepath']);

... I can get the HTML to show the image in a given preset. In my case however, I need to get only the path to the image, not the formatted tag. How can I do that?

Comments

Try this

rohnjeynolds's picture

Found a function defined in the imagecache module that I think delivers what you need:

$path = imagecache_create_path('preset1', $field_pictures[$image_index]['filepath']);

imagecache_create_path

capellic's picture

imagecache_create_path doesn't exist in Drupal 7. Instead, use image_style_url().

http://api.drupal.org/api/drupal/modules--image--image.module/function/i...

Image

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week