src/Sulu/Bundle/MediaBundle/Media/ImageConverter/ImagineImageConverter.php
private function applyTransformations(ImageInterface $image, $tansformations)
    {
        foreach ($tansformations as $transformation) {
            if (!isset($transformation['effect'])) {
                throw new ImageProxyInvalidFormatOptionsException('Effect not found');
            }
            $image = $this->modifyAllLayers(
                $image,
                function(ImageInterface $layer) use ($transformation) {
                    return $this->transformationPool->get($transformation['effect'])->execute(
                        $layer,
                        $transformation['parameters']
                    );
                }
            );
        }

        return $image;
    }
private function applyTransformations(ImageInterface $image, $tansformations)
    {
        foreach ($tansformations as $transformation) {
            if (!isset($transformation['effect'])) {
                throw new ImageProxyInvalidFormatOptionsException('Effect not found');
            }
            $image = $this->modifyAllLayers(
                $image,
                function(ImageInterface $layer) use ($transformation) {
                    return $this->transformationPool->get($transformation['effect'])->execute(
                        $layer,
                        $transformation['parameters']
                    );
                }
            );
        }

        return $image;
    }
private function applyTransformations ( ImageInterface $ image , $ tansformations ) { foreach ( $ tansformations as $ transformation ) { if ( ! isset ( $ transformation [ 'effect' ] ) ) { throw new ImageProxyInvalidFormatOptionsException ( 'Effect not found' ) ; } $ image = $ this -> modifyAllLayers ( $ image , function ( ImageInterface $ layer ) use ( $ transformation ) { return $ this -> transformationPool -> get ( $ transformation [ 'effect' ] ) -> execute ( $ layer , $ transformation [ 'parameters' ] ) ; } ) ; } return $ image ; }
Applies an array of transformations on a passed image.

@param ImageInterface $image
@param $tansformations

@throws ImageProxyInvalidFormatOptionsException

@return ImageInterface The modified image
Applies an array of transformations on a passed image .