diff --git a/imagecache.module b/imagecache.module index 55d48ce..477b0d3 100644 --- a/imagecache.module +++ b/imagecache.module @@ -895,8 +895,17 @@ function theme_imagecache($presetname, $path, $alt = '', $title = '', $attribute 'alt' => $alt, 'title' => $title, ); - if ($getsize && ($image = image_get_info(imagecache_create_path($presetname, $path)))) { - $ours += array('width' => $image['width'], 'height' => $image['height']); + + if ($getsize) { + $cachepath = imagecache_create_path($presetname, $path); + if (!is_file($cachepath)) { + $preset = imagecache_preset_by_name($presetname); + $dst = imagecache_create_path($presetname, $path); + imagecache_build_derivative($preset['actions'], $path, $dst); + } + if ($image = image_get_info($cachepath)) { + $ours += array('width' => $image['width'], 'height' => $image['height']); + } } return '';