You are here

public function GDToolkit::getResource in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::getResource()
  2. 9 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::getResource()

Retrieves the GD image resource.

Return value

\GdImage|null The GD image resource, or NULL if not available.

File

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

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

public function getResource() {
  if (!$this->resource) {
    $this
      ->load();
  }
  return $this->resource;
}