You are here

function photos_preprocess_photos_imagehtml in Album Photos 7.3

Implements hook_preprocess().

File

./photos.module, line 1764
Implementation of photos.module.

Code

function photos_preprocess_photos_imagehtml(&$variables, $hook) {
  $style_name = $variables['style_name'];
  $image = $variables['image'];
  $style_label = isset($image->thumb[$style_name]) ? $image->thumb[$style_name] : '';
  $filename = isset($image->filename) ? strip_tags($image->filename) : '';
  $title = isset($image->title) ? strip_tags($image->title) : $filename;
  $alt = isset($image->alt) ? strip_tags($image->alt) : $title;
  $image->alt = $alt;
  if ($style_name == 'original') {
    $image_styles = image_style_options(FALSE);
    if (isset($image_styles['original'])) {
      $image_view = theme('image_style', array(
        'style_name' => $style_name,
        'path' => $image->uri,
        'alt' => $alt,
        'title' => $alt,
      ));
    }
    else {
      $image_view = theme('image', array(
        'path' => $image->uri,
        'alt' => $alt,
        'title' => $alt,
      ));
    }
  }
  else {
    $image_view = theme('image_style', array(
      'style_name' => $style_name,
      'path' => $image->uri,
      'alt' => $alt,
      'title' => $alt,
    ));
  }
  $image->view = $image_view;
}