You are here

protected function ScaleAndCrop::execute in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/ImageToolkit/Operation/gd/ScaleAndCrop.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\ScaleAndCrop::execute()

Performs the actual manipulation on the image.

Image toolkit operation implementers must implement this method. This method is responsible for actually performing the operation on the image. When this method gets called, the implementer may assume all arguments, also the optional ones, to be available, validated and corrected.

Parameters

array $arguments: An associative array of arguments to be used by the toolkit operation.

Return value

bool TRUE if the operation was performed successfully, FALSE otherwise.

Overrides ImageToolkitOperationBase::execute

File

core/modules/system/src/Plugin/ImageToolkit/Operation/gd/ScaleAndCrop.php, line 76

Class

ScaleAndCrop
Defines GD2 Scale and crop operation.

Namespace

Drupal\system\Plugin\ImageToolkit\Operation\gd

Code

protected function execute(array $arguments = []) {
  return $this
    ->getToolkit()
    ->apply('resize', $arguments['resize']) && $this
    ->getToolkit()
    ->apply('crop', $arguments);
}