Sulu\Bundle\MediaBundle\Media\ImageConverter\MediaImageExtractor::convertPsdToImage PHP Метод

convertPsdToImage() приватный Метод

Converts a PSD to a png using imagine. Only works with Imagick and not with GD.
private convertPsdToImage ( string $content ) : string
$content string
Результат string
    private function convertPsdToImage($content)
    {
        $temporaryFilePath = $this->createTemporaryFile($content);
        try {
            $image = $this->imagine->open($temporaryFilePath);
            $image = $image->layers()[0];
            unlink($temporaryFilePath);
            return $image->get('png');
        } catch (RuntimeException $e) {
            unlink($temporaryFilePath);
            throw new InvalidMimeTypeForPreviewException('image/vnd.adobe.photoshop');
        }
    }