public function GDToolkit::setResource in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::setResource()
- 9 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::setResource()
Sets the GD image resource.
Parameters
\GdImage $resource: The GD image resource.
Return value
$this An instance of the current toolkit object.
File
- core/
modules/ system/ src/ Plugin/ ImageToolkit/ GDToolkit.php, line 124
Class
- GDToolkit
- Defines the GD2 toolkit for image manipulation within Drupal.
Namespace
Drupal\system\Plugin\ImageToolkitCode
public function setResource($resource) {
if (!$resource instanceof \GdImage) {
throw new \InvalidArgumentException('Invalid resource argument');
}
$this->preLoadInfo = NULL;
$this->resource = $resource;
return $this;
}