function 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 430  
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->getImage()) {
    return imagesx($res);
  }
  else {
    return NULL;
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.