--- field_slideshow.module.orig 2011-08-30 17:14:54.000000000 +1000 +++ field_slideshow.module 2011-11-30 21:20:26.000000000 +1100 @@ -685,17 +685,27 @@ function theme_field_slideshow($variable $image_output = theme('image', $image); } - // Get image sizes and add them the img tag, so height is correctly calctulated by Cycle - if (isset($variables['image_style'])) { - $image_path = image_style_path($variables['image_style'], $image['path']); - // if thumbnail is not generated, do it, so we can get the dimensions - if (!file_exists($image_path)) { - image_style_create_derivative(image_style_load($variables['image_style']), $image['path'], $image_path); + if (strpos($image_output, 'width') && strpos($image_output, 'height')) { + preg_match('/width="?(\d+)"?/', $image_output, $match); + $width = (isset($match[1])) ? $match[1] : NULL; + preg_match('/height="?(\d+)"?/', $image_output, $match); + $height = (isset($match[1])) ? $match[1] : NULL; + } + if (isset($width) && isset($height)) { + $image_dims = array($width, $height); + } else { + // Get image sizes and add them the img tag, so height is correctly calctulated by Cycle + if (isset($variables['image_style'])) { + $image_path = image_style_path($variables['image_style'], $image['path']); + // if thumbnail is not generated, do it, so we can get the dimensions + if (!file_exists($image_path)) { + $image_path = image_style_url($variables['image_style'], $image['path']); + } } - } - else $image_path = $image['path']; - $image_dims = getimagesize($image_path); - $image_output = drupal_substr($image_output, 0, -2) . $image_dims[3] . ' />'; + else $image_path = $image['path']; + $image_dims = getimagesize($image_path); + $image_output = drupal_substr($image_output, 0, -2) . $image_dims[3] . ' />'; + } if ($image_dims[0] > $slides_max_width) $slides_max_width = $image_dims[0]; if ($image_dims[1] > $slides_max_height) $slides_max_height = $image_dims[1];