/** * @param string путь к файлу с изображением * @throws UnsupportedFormatException */ protected function __construct($filePath) { if (!self::isSupport()) { throw new UnsupportedFormatException('jpeg'); } parent::__construct($filePath); $path = parent::getFilePath(); parent::setResource(@imagecreatefromjpeg($path)); }