You are here

public function ImagickToolkit::getWidth in Imagick 8

Returns the width of the image.

Return value

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

Overrides ImageToolkitInterface::getWidth

File

src/Plugin/ImageToolkit/ImagickToolkit.php, line 202

Class

ImagickToolkit
Defines the Imagick toolkit for image manipulation within Drupal.

Namespace

Drupal\imagick\Plugin\ImageToolkit

Code

public function getWidth() {
  if (!$this
    ->getResource()) {
    return NULL;
  }
  return $this
    ->getResource()
    ->getImageGeometry()['width'];
}