public Image::__construct(ImageToolkitInterface $toolkit, $source = NULL)
Constructs a new Image object.
\Drupal\Core\ImageToolkit\ImageToolkitInterface $toolkit: The image toolkit.
string|null $source: (optional) The path to an image file, or NULL to construct the object with no image source.
public function __construct(ImageToolkitInterface $toolkit, $source = NULL) { $this->toolkit = $toolkit; if ($source) { $this->source = $source; $this->getToolkit()->setSource($this->source); // Defer image file validity check to the toolkit. if ($this->getToolkit()->parseFile()) { $this->fileSize = filesize($this->source); } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Image!Image.php/function/Image::__construct/8.1.x