You are here

public function GDToolkit::getHeight in Zircon Profile 8

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

Returns the height of the image.

Return value

int|null The height of the image, or NULL if the image is invalid.

Overrides ImageToolkitInterface::getHeight

File

core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php, line 320
Contains \Drupal\system\Plugin\ImageToolkit\GDToolkit.

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

public function getHeight() {
  if ($this->preLoadInfo) {
    return $this->preLoadInfo[1];
  }
  elseif ($res = $this
    ->getResource()) {
    return imagesy($res);
  }
  else {
    return NULL;
  }
}