function ImageToolkitInterface::crop

Crops an image.

Parameters

object $image: An image object. The $image->resource, $image->info['width'], and $image->info['height'] values will be modified by this call.

int $x: The starting x offset at which to start the crop, in pixels.

int $y: The starting y offset at which to start the crop, in pixels.

int $width: The width of the cropped area, in pixels.

int $height: The height of the cropped area, in pixels.

Return value

bool TRUE or FALSE, based on success.

See also

image_crop()

2 methods override ImageToolkitInterface::crop()
GDToolkit::crop in drupal/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
Implements \Drupal\system\Plugin\ImageToolkitInterface::crop().
TestToolkit::crop in drupal/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php
Implements \Drupal\system\Plugin\ImageToolkitInterface::crop().

File

drupal/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitInterface.php, line 92
Contains \Drupal\system\Plugin\ImageToolkitInterface.

Class

ImageToolkitInterface
Defines an interface for image toolkits.

Namespace

Drupal\system\Plugin

Code

function crop($image, $x, $y, $width, $height);