diff --git a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php index 8437974..e27c705 100644 --- a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php @@ -102,7 +102,7 @@ protected function execute(array $arguments) { // Check if enough memory is available. $rect = new Rectangle($this->getToolkit()->getWidth(), $this->getToolkit()->getHeight()); $rect = $rect->rotate($arguments['degrees']); - $memory = $this->getToolkit()->isMemoryAvailable($arguments['width'], $arguments['height']); + $memory = $this->getToolkit()->isMemoryAvailable($rect->getBoundingWidth(), $rect->getBoundingHeight()); if ($memory !== TRUE) { throw new \RuntimeException("Not enough memory (required: {$memory['required']['size']} {$memory['required']['unit']}, free: {$memory['free']['size']} {$memory['free']['unit']}, total: {$memory['total']['size']} {$memory['total']['unit']}) to perform the image '{$this->getPluginId()}' operation"); } diff --git a/core/modules/system/tests/src/Unit/Plugin/ImageToolkit/GdToolkitTest.php b/core/modules/system/tests/src/Unit/Plugin/ImageToolkit/GdToolkitTest.php index 86a21a4..d97657b 100644 --- a/core/modules/system/tests/src/Unit/Plugin/ImageToolkit/GdToolkitTest.php +++ b/core/modules/system/tests/src/Unit/Plugin/ImageToolkit/GdToolkitTest.php @@ -123,7 +123,7 @@ public function testLoad() { $this->setToolkitMock(['isMemoryAvailable']); $this->toolkit->expects($this->any()) ->method('isMemoryAvailable') - ->will($this->returnValue(TRUE); + ->will($this->returnValue(TRUE)); $this->image = new Image($this->toolkit, $this->source); $this->assertTrue(is_resource($this->image->getToolkit()->getResource()));