Implements \Drupal\system\Plugin\ImageToolkitInterface::resize().
Overrides ImageToolkitInterface::resize
public function resize($image, $width, $height) {
$res = $this
->createTmp($image, $width, $height);
if (!imagecopyresampled($res, $image->resource, 0, 0, 0, 0, $width, $height, $image->info['width'], $image->info['height'])) {
return FALSE;
}
imagedestroy($image->resource);
// Update image object.
$image->resource = $res;
$image->info['width'] = $width;
$image->info['height'] = $height;
return TRUE;
}