From 63b9e4770b7bf205a9b707264cb6f77354f77ecd Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 22 Sep 2010 03:24:09 +0000 Subject: - Patch #908282 by jbrown: theme_image() performs I/O. --- modules/color/color.module | 2 +- modules/image/image.admin.inc | 4 ++-- modules/image/image.field.inc | 2 +- modules/image/image.module | 1 - modules/image/image.test | 6 +----- modules/user/user.module | 4 ++-- 6 files changed, 7 insertions(+), 12 deletions(-) (limited to 'modules') diff --git a/modules/color/color.module b/modules/color/color.module index 01341a618..a9d898090 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -63,7 +63,7 @@ function _color_theme_select_form_alter(&$form, &$form_state) { foreach (element_children($form) as $theme) { if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { if (isset($form[$theme]['screenshot'])) { - $form[$theme]['screenshot']['#markup'] = theme('image', array('path' => $screenshot, 'alt' => '', 'title' => '', 'attributes' => array('class' => array('screenshot')), 'getsize' => FALSE)); + $form[$theme]['screenshot']['#markup'] = theme('image', array('path' => $screenshot, 'title' => '', 'attributes' => array('class' => array('screenshot')))); } } } diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index ce1b039b6..657781156 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -793,7 +793,7 @@ function theme_image_style_preview($variables) { $output .= '
'; $output .= t('original') . ' (' . l(t('view actual size'), $original_path) . ')'; $output .= ''; // End preview-image. @@ -803,7 +803,7 @@ function theme_image_style_preview($variables) { $output .= '
'; $output .= check_plain($style['name']) . ' (' . l(t('view actual size'), file_create_url($preview_file) . '?' . time()) . ')'; $output .= ''; // End preview-image. diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 15c287a69..b54e601ab 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -338,7 +338,7 @@ function image_field_widget_process($element, &$form_state, $form) { if ($element['#file'] && $widget_settings['preview_image_style']) { $element['preview'] = array( '#type' => 'markup', - '#markup' => theme('image_style', array('style_name' => $widget_settings['preview_image_style'], 'path' => $element['#file']->uri, 'getsize' => FALSE)), + '#markup' => theme('image_style', array('style_name' => $widget_settings['preview_image_style'], 'path' => $element['#file']->uri)), ); } diff --git a/modules/image/image.module b/modules/image/image.module index bb6e07985..36807a8e5 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -1105,7 +1105,6 @@ function theme_image_style($variables) { $style_path = image_style_url($style_name, $path); } $variables['path'] = $style_path; - $variables['getsize'] = FALSE; return theme('image', $variables); } diff --git a/modules/image/image.test b/modules/image/image.test index 0709d918b..33c1000c1 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -650,7 +650,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $image_uri = $node->{$field_name}[LANGUAGE_NONE][0]['uri']; $image_info = array( 'path' => $image_uri, - 'getsize' => TRUE, ); $default_output = theme('image', $image_info); $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.')); @@ -746,7 +745,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $node = node_load($nid, NULL, TRUE); $image_info = array( 'path' => image_style_url('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), - 'getsize' => FALSE, ); $default_output = theme('image', $image_info); $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style.")); @@ -756,7 +754,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { 'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], 'alt' => $this->randomName(), 'title' => $this->randomName(), - 'getsize' => TRUE, ); $edit = array( $field_name . '[' . LANGUAGE_NONE . '][0][alt]' => $image_info['alt'], @@ -793,7 +790,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { field_info_cache_clear(); $field = field_info_field($field_name); $image = file_load($field['settings']['default_image']); - $default_output = theme('image', array('path' => $image->uri, 'getsize' => TRUE)); + $default_output = theme('image', array('path' => $image->uri)); $this->drupalGet('node/' . $node->nid); $this->assertRaw($default_output, t('Default image displayed when no user supplied image is present.')); @@ -803,7 +800,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $node = node_load($nid, NULL, TRUE); $image_info = array( 'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], - 'getsize' => TRUE, ); $image_output = theme('image', $image_info); $this->drupalGet('node/' . $nid); diff --git a/modules/user/user.module b/modules/user/user.module index c1eae4fb8..b43b689fd 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1410,10 +1410,10 @@ function template_preprocess_user_picture(&$variables) { if (isset($filepath)) { $alt = t("@user's picture", array('@user' => format_username($account))); if (module_exists('image') && $style = variable_get('user_picture_style', '')) { - $variables['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt, 'attributes' => array(), 'getsize' => FALSE)); + $variables['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt)); } else { - $variables['user_picture'] = theme('image', array('path' => $filepath, 'alt' => $alt, 'title' => $alt, 'attributes' => array(), 'getsize' => FALSE)); + $variables['user_picture'] = theme('image', array('path' => $filepath, 'alt' => $alt, 'title' => $alt)); } if (!empty($account->uid) && user_access('access user profiles')) { $attributes = array('attributes' => array('title' => t('View user profile.')), 'html' => TRUE); -- cgit v1.2.3