public function GDToolkit::getWidth in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::getWidth()
 
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
- core/
modules/ system/ src/ Plugin/ ImageToolkit/ GDToolkit.php, line 305  - Contains \Drupal\system\Plugin\ImageToolkit\GDToolkit.
 
Class
- GDToolkit
 - Defines the GD2 toolkit for image manipulation within Drupal.
 
Namespace
Drupal\system\Plugin\ImageToolkitCode
public function getWidth() {
  if ($this->preLoadInfo) {
    return $this->preLoadInfo[0];
  }
  elseif ($res = $this
    ->getResource()) {
    return imagesx($res);
  }
  else {
    return NULL;
  }
}