diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index b736b18..84c5dc0 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -109,9 +109,8 @@ function template_preprocess_image_style_preview(&$variables) { $variables['preview']['original']['height'] = min($variables['original']['height'], $sample_height); $variables['preview']['original']['width'] = round($variables['preview']['original']['height'] / $variables['original']['height'] * $variables['original']['width']); } - $variables['original']['style'] = 'width: ' . $variables['preview']['original']['width'] . 'px; height: ' . $variables['preview']['original']['height'] . 'px;'; - // Set up preview file information. + // Set up derivative file information. $preview_file = $style->buildUri($original_path); // Create derivative if necessary. if (!file_exists($preview_file)) { @@ -131,7 +130,6 @@ function template_preprocess_image_style_preview(&$variables) { $variables['preview']['derivative']['height'] = min($variables['derivative']['height'], $sample_height); $variables['preview']['derivative']['width'] = round($variables['preview']['derivative']['height'] / $variables['derivative']['height'] * $variables['derivative']['width']); } - $variables['derivative']['style'] = 'width: ' . $variables['preview']['derivative']['width'] . 'px; height: ' . $variables['preview']['derivative']['height'] . 'px;'; // Build the preview of the original image. $variables['original']['rendered'] = array( @@ -142,12 +140,12 @@ function template_preprocess_image_style_preview(&$variables) { '#attributes' => array( 'width' => $variables['original']['width'], 'height' => $variables['original']['height'], - 'style' => $variables['original']['style'], + 'style' => 'width: ' . $variables['preview']['original']['width'] . 'px; height: ' . $variables['preview']['original']['height'] . 'px;', ), ); - // In the preview, timestamps are added to prevent caching of images. - // Build the preview of the image style. + // Build the preview of the image style derivative. Timestamps are added + // to prevent caching of images on the client side. $variables['derivative']['rendered'] = array( '#theme' => 'image', '#uri' => $variables['derivative']['url'] . '?cache_bypass=' . $variables['cache_bypass'], @@ -156,7 +154,7 @@ function template_preprocess_image_style_preview(&$variables) { '#attributes' => array( 'width' => $variables['derivative']['width'], 'height' => $variables['derivative']['height'], - 'style' => $variables['derivative']['style'], + 'style' => 'width: ' . $variables['preview']['derivative']['width'] . 'px; height: ' . $variables['preview']['derivative']['height'] . 'px;', ), );