Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I just wanted to know if there is some way to make Drupal 7 re-build all the images for a specific style. The image style is created after the pictures were uploaded. The module using this image style will be color box.
Even though I update, delete, re-create the style, no images are generated in the according folder on the webspace.

Do you have any idea?

share|improve this question

migrated from stackoverflow.com Aug 26 '11 at 19:23

This question came from our site for professional and enthusiast programmers.

    
My problem right now is, that I don't know how to implement this for my gallery custom post type and for multiple images. –  user2666 Aug 26 '11 at 20:29
    
add comment

2 Answers 2

You can use drush to re-build specific image styles. drush image-flush thumbnail will force the refresh of thumbnail styles; you can use drush image-flush to get a list of available styles to clear.

You can find more information on the Drush website.

share|improve this answer
add comment

I used to have problems updating images after image styles were changed. Images would remain the same size they were before the style updates. Then I realized the problem was with my template files. I used to have static references to images, in the styles directories, which was wrong.

Then I realized I should use a function to display those images. This is how I do it now:

<img src="<?php print image_style_url('large', $node->field_image[$node->language][0]['uri']) ?>" />

The 'large' attribute is the image style name, you can use 'medium', 'thumbnail' or whatever custom style you have defined.

This solved the problem for me. When displayed, images appear according to the latest definition I have applied.

I don't know how Colorbox handles images with styles. Anyway, I hope my answer helps you.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.