diff --git a/core/lib/Drupal/Core/Image/Image.php b/core/lib/Drupal/Core/Image/Image.php index b39dac3..0d78181 100644 --- a/core/lib/Drupal/Core/Image/Image.php +++ b/core/lib/Drupal/Core/Image/Image.php @@ -195,7 +195,7 @@ public function scaleAndCrop($width, $height) { /** * {@inheritdoc} */ - public function scaleAndCropWithAnchor($x, $y, $width, $height) { + public function scaleAndCropWithOffset($x, $y, $width, $height) { return $this->apply('scale_and_crop', ['x' => $x, 'y' => $y, 'width' => $width, 'height' => $height]); } diff --git a/core/lib/Drupal/Core/Image/ImageInterface.php b/core/lib/Drupal/Core/Image/ImageInterface.php index 529e2d1..e751836 100644 --- a/core/lib/Drupal/Core/Image/ImageInterface.php +++ b/core/lib/Drupal/Core/Image/ImageInterface.php @@ -170,7 +170,7 @@ public function scale($width, $height = NULL, $upscale = FALSE); public function scaleAndCrop($width, $height); /** - * Scales an image to the exact width and height given (with an anchor). + * Scales an image to the exact width and height given (with an offset). * * This function achieves the target aspect ratio by cropping the original * image according to the x and y offsets. @@ -188,7 +188,7 @@ public function scaleAndCrop($width, $height); * @return bool * TRUE on success, FALSE on failure. */ - public function scaleAndCropWithAnchor($x, $y, $width, $height); + public function scaleAndCropWithOffset($x, $y, $width, $height); /** * Instructs the toolkit to save the image in the format specified by the diff --git a/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php index e9569b2..02171a5 100644 --- a/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php @@ -27,7 +27,7 @@ public function applyEffect(ImageInterface $image) { $x = image_filter_keyword($x, $image->getWidth() * $scale, $width); $y = image_filter_keyword($y, $image->getHeight() * $scale, $height); - if (!$image->scaleAndCropWithAnchor($x, $y, $width, $height)) { + if (!$image->scaleAndCropWithOffset($x, $y, $width, $height)) { $this->logger->error('Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', ['%toolkit' => $image->getToolkitId(), '%path' => $image->getSource(), '%mimetype' => $image->getMimeType(), '%dimensions' => $image->getWidth() . 'x' . $image->getHeight()]); return FALSE; }