function GDToolkit::setImage

Same name and namespace in other branches
  1. 11.x core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::setImage()

Sets an image or resets existing one.

Parameters

\GdImage|null $image: The GD image object or NULL.

Return value

$this An instance of the current toolkit object.

2 calls to GDToolkit::setImage()
GDToolkit::load in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Loads an image from a file.
GDToolkit::setResource in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Sets the GD image resource.

File

core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php, line 202

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

public function setImage(?\GdImage $image) : static {
    $this->preLoadInfo = NULL;
    $this->image = $image;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.