diff --git modules/image/image.module modules/image/image.module index 23f2e9b..282a8dc 100644 --- modules/image/image.module +++ modules/image/image.module @@ -1091,9 +1091,6 @@ function theme_image_style($variables) { // The derivative image is not created until it has been requested so the file // may not yet exist, in this case we just fallback to the URL. $style_path = image_style_path($style_name, $path); - if (!file_exists($style_path)) { - $style_path = image_style_url($style_name, $path); - } $variables['path'] = $style_path; return theme('image', $variables); } diff --git modules/image/image.test modules/image/image.test index 7529add..6c968c3 100644 --- modules/image/image.test +++ modules/image/image.test @@ -582,7 +582,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { // Test that image is displayed using newly created style. $this->drupalGet('node/' . $nid); - $this->assertRaw(image_style_url($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style @style.', array('@style' => $style_name))); + $this->assertRaw(file_create_url(image_style_path($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri'])), t('Image displayed using style @style.', array('@style' => $style_name))); // Rename the style and make sure the image field is updated. $new_style_name = strtolower($this->randomName(10)); @@ -592,7 +592,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { $this->drupalPost('admin/config/media/image-styles/edit/' . $style_name, $edit, t('Update style')); $this->assertText(t('Changes to the style have been saved.'), t('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name))); $this->drupalGet('node/' . $nid); - $this->assertRaw(image_style_url($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.')); + $this->assertRaw(file_create_url(image_style_path($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri'])), t('Image displayed using style replacement style.')); // Delete the style and choose a replacement style. $edit = array( @@ -603,7 +603,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { $this->assertRaw($message, $message); $this->drupalGet('node/' . $nid); - $this->assertRaw(image_style_url('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.')); + $this->assertRaw(file_create_url(image_style_path('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri'])), t('Image displayed using style replacement style.')); } } @@ -743,7 +743,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // style. $node = node_load($nid, NULL, TRUE); $image_info = array( - 'path' => image_style_url('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), + 'path' => file_create_url(image_style_path('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri'])), ); $default_output = theme('image', $image_info); $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style.")); diff --git modules/user/user.test modules/user/user.test index 31e19e2..53b7371 100644 --- modules/user/user.test +++ modules/user/user.test @@ -887,7 +887,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->assertRaw($text, t('Image was resized.')); $alt = t("@user's picture", array('@user' => format_username($this->user))); $style = variable_get('user_picture_style', ''); - $this->assertRaw(image_style_url($style, $pic_path), t("Image is displayed in user's edit page")); + $this->assertRaw(file_create_url(image_style_path($style, $pic_path), t("Image is displayed in user's edit page"))); // Check if file is located in proper directory. $this->assertTrue(is_file($pic_path), t("File is located in proper directory"));