You are here

function theme_emthumb_image in Embedded Media Field 5

Same name and namespace in other branches
  1. 6.3 contrib/emthumb/emthumb.module \theme_emthumb_image()
  2. 6 contrib/emthumb/emthumb.module \theme_emthumb_image()
  3. 6.2 contrib/emthumb/emthumb.module \theme_emthumb_image()
2 theme calls to theme_emthumb_image()
theme_emthumb_view_image in contrib/emthumb/emthumb.module
_emthumb_widget_form in contrib/emthumb/emthumb.module

File

contrib/emthumb/emthumb.module, line 537

Code

function theme_emthumb_image($file, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {

  // print_r($file);
  $file = (array) $file;
  if (!$getsize || is_file($file['filepath']) && (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath']))) {
    $attributes = drupal_attributes($attributes);
    $path = $file['fid'] == 'upload' ? $file['preview'] : $file['filepath'];
    $alt = empty($alt) ? $file['emthumb_alt'] : $alt;
    $title = empty($title) ? $file['emthumb_title'] : $title;
    $url = file_create_url($path);
    return '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" ' . $image_attributes . $attributes . ' />';
  }
}