/** * Constructor * * @param string|null $filename * @param bool|null $strict * * @throws Exception * @throws \JBZoo\Utils\Exception */ public function __construct($filename = null, $strict = false) { Helper::checkGD(); if (ctype_print($filename) && FS::isFile($filename)) { $this->loadFile($filename); } elseif (Helper::isGdRes($filename)) { $this->loadResource($filename); } elseif (is_string($filename) && $filename) { $this->loadString($filename, $strict); } }