diff --git a/imagecache_token.module b/imagecache_token.module index 785fbc0..dc9d0e2 100644 --- a/imagecache_token.module +++ b/imagecache_token.module @@ -186,14 +186,17 @@ function imagecache_token_tokens($type, $tokens, array $data = array(), array $o elseif (isset($attribute) && !empty($attribute) && isset($field[$attribute])) { if (in_array($attribute, array('width', 'height', 'mimetype'))) { $styled_uri = image_style_path($type, $field['uri']); - $style = image_style_load($type); - // Imagecrop module support. - global $imagecrop_style; - $imagecrop_style = $type; + if (!file_exists($styled_uri)) { + $style = image_style_load($type); - // Create a derivative of the image for this style. - image_style_create_derivative($style, $field['uri'], $styled_uri); + // Imagecrop module support. + global $imagecrop_style; + $imagecrop_style = $type; + + // Create a derivative of the image for this style. + image_style_create_derivative($style, $field['uri'], $styled_uri); + } // If the styled image's information wasn't loaded before then load // it now; as this process is a little heavy, the information will