3

I edited the actions on one of my imagecache presets, but it has only generated a few pictures (instead of hundreds) of pictures.

I am using the preset to in a view to show thumbnails that belong to nodes of a specific content type with the help of a module called teaser thumbnail. All the thumbnails on the first page of the view have been generated correctly, but beyond that, none of the thumbnails have been generated.

I am using Drupal 6.25 with public file system on a shared hosting server.

So the main question is how do forcefully rebuild/re-generate the pictures associated with preset?

Edit : I have already used the 'Flush' function on the preset.

  • I believe this is a duplicate of Manually flush ImageCache cache? where you will also find the answer you seek. :) – Letharion Apr 17 '12 at 15:44
  • 1
    I have already tried the flushing the preset. As mentioned in the comment, only a few images have been generated (1 thumbnail for every 10 articles on the 1st page of the view for the different content types on the site) – bcosynot Apr 17 '12 at 15:47
3

Imagecache images are generated on the fly when a browser requests them, rather than when you create the preset or flush the images.

Basically, this is how the process works.

When a URL 404s, the request gets punted to /index.php and handled by Drupal.

The imagecache module has a hook_menu() entry that handles all of the requests to sites/default/files/imagecache (or whatever file_directory_path() returns for your site).

The callback for this checks for the requested filename. If the file exists (ie, the derivative has been generated and exists in the filesystem), it gets served up. Otherwise, the module makes the derivative, saves it to the filesystem, and then serves it up.

So, the net result is that you don't need to explicitly generate the derivatives. When a page that has them on it is requested, they will be automacically generated.

If you would like to pre-generete them for performance reasons, then my suggestion would be to write a bash script to find all of the images in your sites/default/files directory, and then wget them with the proper imagecache preset path name.

If you are looking at a page and the thumbnails aren't being shown, then you have another problem. Checking the system report would be the first place to check. Typically, the webserver can't write to the filesystem or your image toolkit is messed up.

  • I am looking at the page and the thumbnails aren't turning up. The status report is OK all the way, no red alerts there. I am using the public file system and all the required folder permissions are correct – bcosynot Apr 17 '12 at 16:23
  • Watch the page load with Live HTTP Headers, or something similar. That my provide a little guidance on what is wrong. My guess would be something is wrong with the image paths on that page. – mpdonadio Apr 17 '12 at 16:26
  • Ah, I am getting the 500 (internal server error) error code for the images that don't show up. Must be some other screw up. – bcosynot Apr 17 '12 at 16:32
  • Yeah, something else is wrong. You could be running out of PHP memory only when the thumbnails are being generated. Apache error_log will have details. – mpdonadio Apr 17 '12 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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