Throughout various projects I've had to add specific validation before actually building the image cache itself. I'd like to suggest the inclusion of a hook (imagecache_preprocess_cache) just before building the cache inside _imagecache_cache (imagecache.module):

// Preprocess image before cache is generated.
  module_invoke_all('imagecache_preprocess_cache', $preset, $src, $dst);

  // check if deriv exists... (file was created between apaches request handler and reaching this code)
  // otherwise try to create the derivative.
  if (file_exists($dst) || imagecache_build_derivative($preset['actions']....

This will allow other modules to intercept the imagecache processing before the image starts being processed.

Members fund testing for the Drupal project. Drupal Association Learn more


vgardner’s picture

vgardner’s picture

This path includes the hook to the api documentation file.

vgardner’s picture

Issue summary: View changes