Index: imagecache.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.module,v retrieving revision 1.68.2.8 diff -u -r1.68.2.8 imagecache.module --- imagecache.module 9 Jul 2008 02:58:07 -0000 1.68.2.8 +++ imagecache.module 22 Aug 2008 10:04:19 -0000 @@ -451,34 +451,40 @@ return false; } - if (!$image = imageapi_image_open($src)) { - return false; + if (empty($actions)) { + file_copy($src, $dst, FILE_EXISTS_REPLACE); + return @chmod($dst, 0775); } - - foreach ($actions as $action) { - if (!empty($action['data'])) { - // QuickSketch, why do these run first/twice? - dopry. - if (isset($action['data']['width'])) { - $width = _imagecache_filter('width', $action['data']['width'], $image->info['width'], $image->info['height']); - } - if (isset($action['data']['height'])) { - $height = _imagecache_filter('height', $action['data']['height'], $image->info['width'], $image->info['height']); + else { + if (!$image = imageapi_image_open($src)) { + return false; + } + + foreach ($actions as $action) { + if (!empty($action['data'])) { + // QuickSketch, why do these run first/twice? - dopry. + if (isset($action['data']['width'])) { + $width = _imagecache_filter('width', $action['data']['width'], $image->info['width'], $image->info['height']); + } + if (isset($action['data']['height'])) { + $height = _imagecache_filter('height', $action['data']['height'], $image->info['width'], $image->info['height']); + } + foreach ($action['data'] as $key => $value) { + $action['data'][$key] = _imagecache_filter($key, $value, $image->info['width'], $image->info['height'], $width, $height); + } } - foreach ($action['data'] as $key => $value) { - $action['data'][$key] = _imagecache_filter($key, $value, $image->info['width'], $image->info['height'], $width, $height); + if (!_imagecache_apply_action($action, $image)) { + watchdog( 'imagecache', t('action(id:%id): %action failed for %src', array('%id' => $action['actionid'], '%action' => $action['action'], '%src' => $src)), WATCHDOG_ERROR); + return false; } } - if (!_imagecache_apply_action($action, $image)) { - watchdog( 'imagecache', t('action(id:%id): %action failed for %src', array('%id' => $action['actionid'], '%action' => $action['action'], '%src' => $src)), WATCHDOG_ERROR); - return false; - } - } - if (!imageapi_image_close($image, $dst)) { - if (file_exists($dst)) { - watchdog('imagecache', t('Cached image file already exists. There is an issue with your Rewrite configuration.'), WATCHDOG_ERROR); + if (!imageapi_image_close($image, $dst)) { + if (file_exists($dst)) { + watchdog('imagecache', t('Cached image file already exists. There is an issue with your Rewrite configuration.'), WATCHDOG_ERROR); + } + return false; } - return false; } return true;