protected function __construct($filePath) { parent::__construct($filePath); $path = parent::getFilePath(); parent::setResource(@imagecreatefrompng($path)); }