diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php index 9c8e690..76daf78 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php +++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php @@ -42,15 +42,16 @@ public function prepare(ImageInterface $image, array &$arguments) { $arguments['width'] = (int) round($arguments['width']); $arguments['height'] = (int) round($arguments['height']); - if ($arguments['width'] < 0 || $arguments['height'] < 0) { - return FALSE; - } } /** * {@inheritdoc} */ public function apply(ImageInterface $image, array $arguments = array()) { + if ($arguments['width'] < 0 || $arguments['height'] < 0) { + return FALSE; + } + $res = $this->toolkit->createTmp($image, $arguments['width'], $arguments['height']); if (!imagecopyresampled($res, $image->getResource(), 0, 0, 0, 0, $arguments['width'], $arguments['height'], $image->getWidth(), $image->getHeight())) {