function Scale::execute
Overrides Resize::execute
File
-
core/
modules/ system/ src/ Plugin/ ImageToolkit/ Operation/ gd/ Scale.php, line 83
Class
- Scale
- Defines GD2 Scale operation.
Namespace
Drupal\system\Plugin\ImageToolkit\Operation\gdCode
protected function execute(array $arguments = []) {
// Don't scale if we don't change the dimensions at all.
if ($arguments['width'] !== $this->getToolkit()
->getWidth() || $arguments['height'] !== $this->getToolkit()
->getHeight()) {
// Don't upscale if the option isn't enabled.
if ($arguments['upscale'] || $arguments['width'] <= $this->getToolkit()
->getWidth() && $arguments['height'] <= $this->getToolkit()
->getHeight()) {
return parent::execute($arguments);
}
}
return TRUE;
}