Mike42\Escpos\ImagickEscposImage::getRasterFormatFromFile PHP Method

getRasterFormatFromFile() protected method

protected getRasterFormatFromFile ( string $filename = null ) : string | null
$filename string Filename to load from
return string | null Raster format data, or NULL if no optimised renderer is available in this implementation.
    protected function getRasterFormatFromFile($filename = null)
    {
        if ($filename === null) {
            return null;
        }
        $im = $this->getImageFromFile($filename);
        $this->setImgWidth($im->getimagewidth());
        $this->setImgHeight($im->getimageheight());
        /* Convert to PBM and extract raster portion */
        $im = self::alphaRemove($im);
        $im->setFormat('pbm');
        return $this->getRasterBlobFromImage($im);
    }