You are here

function gallery_assist_image_prev_more_info in Gallery Assist 6

1 call to gallery_assist_image_prev_more_info()
gallery_assist_display_item_default in ./gallery_assist.module
Build the output to display each gallery image. Call the own pager and the theme.

File

./gallery_assist.module, line 5282
Drupal content type with gallery functionality.

Code

function gallery_assist_image_prev_more_info($img, $conf) {
  $direction = $img['width'] > $img['height'] ? 'width' : 'height';
  $contra = $img['width'] > $img['height'] ? 'height' : 'width';
  if ($img[$direction] > $conf['preview_size']) {
    $ratio = $conf['preview_size'] / $img[$direction];
    $img["new_{$direction}"] = $conf['preview_size'];
    $img["new_{$contra}"] = $img[$contra] * $ratio;
  }
  else {
    $img["new_{$direction}"] = $img[$direction];
    $img["new_{$contra}"] = $img[$contra];
  }
  return $img;
}