public function GDToolkit::getWidth in Drupal 9
Same name and namespace in other branches
- 8 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 327
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;
}
}