Spatie\PdfToImage\Pdf::determineOutputFormat PHP Method

determineOutputFormat() protected method

Determine in which format the image must be rendered.
protected determineOutputFormat ( $pathToImage ) : string
$pathToImage
return string
    protected function determineOutputFormat($pathToImage)
    {
        $outputFormat = pathinfo($pathToImage, PATHINFO_EXTENSION);
        if ($this->outputFormat != '') {
            $outputFormat = $this->outputFormat;
        }
        $outputFormat = strtolower($outputFormat);
        if (!$this->isValidOutputFormat($outputFormat)) {
            $outputFormat = 'jpg';
        }
        return $outputFormat;
    }