function lmds_imagefield_image($file, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) { $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']; $title = empty($title) ? $file['title'] : $title; //drupal_add_js(path_to_theme() . '/thickbox.js'); // drupal_add_css(path_to_theme() . '/thickbox.css'); if ($width >= $height) { $preset = '185x150sc'; } else { $preset = '150x185sc'; } return '' . theme('imagecache', $preset, $path) . ''; } }