function template_preprocess_imagezoom_thumb in Image Zoom 7.2
Same name and namespace in other branches
- 8.3 imagezoom.module \template_preprocess_imagezoom_thumb()
- 8.2 modules/imagezoom_gallery/imagezoom_gallery.module \template_preprocess_imagezoom_thumb()
Preprocess function for imagezoom_thumb.
File
- modules/
imagezoom_gallery/ imagezoom_gallery.module, line 177 - Provides a gallery formatter for the Image Zoom module.
Code
function template_preprocess_imagezoom_thumb(&$variables) {
$item = $variables['item'];
if ($variables['display_style']) {
$variables['image'] = image_style_url($variables['display_style'], $item['uri']);
}
else {
$variables['image'] = file_create_url($item['uri']);
}
if ($variables['zoom_style']) {
$variables['zoom'] = image_style_url($variables['zoom_style'], $item['uri']);
}
else {
$variables['zoom'] = file_create_url($item['uri']);
}
if ($variables['thumb_style']) {
$variables['thumb'] = image_style_url($variables['thumb_style'], $item['uri']);
$info = image_get_info($variables['thumb']);
}
else {
$variables['thumb'] = file_create_url($item['uri']);
$info = image_get_info($item['uri']);
}
$variables['width'] = $info['width'];
$variables['height'] = $info['height'];
}