$variables['image_style'], 'path' => $variables['image_uri'], 'alt' => $variables['alt'], 'title' => $variables['title'], 'getsize' => FALSE, 'attributes' => $variables['attributes'])); } else { $output = theme('image', array('path' => $variables['image_uri'], 'alt' => $variables['alt'], 'title' => $variables['title'], 'getsize' => FALSE, 'attributes' => $variables['attributes'])); } return $output; } /** * Preview image for Styles UI. */ function theme_file_styles_image_preview($variables) { // Media requires a file object. // Also, image_style_url() crashes if you send it a file from a module. // Thus, we need to copy it to the public:// directory first, for styles // that need to use an image style. // @see http://drupal.org/node/987846#comment-3949112 $sample_image = file_styles_preview_image(); $variables['object'] = file_uri_to_object($sample_image); $variables['field_type'] = 'file'; return theme('styles', $variables); }