src/Sulu/Bundle/MediaBundle/Media/ImageConverter/MediaImageExtractor.php
private function convertPsdToImage($resource)
    {
        $temporaryFilePath = $this->createTemporaryFile($resource);

        try {
            $image = $this->imagine->open($temporaryFilePath);
            $image = $image->layers()[0];

            unlink($temporaryFilePath);

            return $this->createTemporaryResource($image->get('png'));
        } catch (RuntimeException $e) {
            unlink($temporaryFilePath);

            throw new InvalidMimeTypeForPreviewException('image/vnd.adobe.photoshop');
        }
    }
private function convertPsdToImage($resource)
    {
        $temporaryFilePath = $this->createTemporaryFile($resource);

        try {
            $image = $this->imagine->open($temporaryFilePath);
            $image = $image->layers()[0];

            unlink($temporaryFilePath);

            return $this->createTemporaryResource($image->get('png'));
        } catch (RuntimeException $e) {
            unlink($temporaryFilePath);

            throw new InvalidMimeTypeForPreviewException('image/vnd.adobe.photoshop');
        }
    }
private function convertPsdToImage ( $ resource ) { $ temporaryFilePath = $ this -> createTemporaryFile ( $ resource ) ; try { $ image = $ this -> imagine -> open ( $ temporaryFilePath ) ; $ image = $ image -> layers ( ) [ 0 ] ; unlink ( $ temporaryFilePath ) ; return $ this -> createTemporaryResource ( $ image -> get ( 'png' ) ) ; } catch ( RuntimeException $ e ) { unlink ( $ temporaryFilePath ) ; throw new InvalidMimeTypeForPreviewException ( 'image/vnd.adobe.photoshop' ) ; } }
Converts a PSD to a png using imagine. Only works with Imagick and not with GD.

@param resource $resource

@return resource

@throws InvalidMimeTypeForPreviewException
Converts a PSD to a png using imagine . Only works with Imagick and not with GD .