private function registerImageFilters(ContainerBuilder $container)
    {
        $medias = [
            'lg' => 1140,
            'md' => 940,
            'sm' => 720,
            'xs' => 480,
        ];

        $filterSets = [];

        foreach ($medias as $size => $width) {
            for ($column = 1; $column <= 12; $column++) {
                $number = 12 / $column;

                $filterSets[sprintf('col_%s_%d', $size, $column)] = [
                    'cache'           => 'local_media',
                    'data_loader'     => 'local_media',
                    'filters'         => [
                        'relative_resize' => ['widen' => round(($width - ($number - 1) * 30) / $number)],
                    ],
                    'post_processors' => [
                        'jpegoptim' => ['strip_all' => true, 'max' => "%image.jpeg_quality%", 'progressive' => true],
                        'pngquant'  => ['quality' => "%image.png_quality%"],
                    ],
                ];
            }
        }

        $container->prependExtensionConfig('liip_imagine', [
            'filter_sets' => $filterSets,
        ]);
    }
private function registerImageFilters(ContainerBuilder $container)
    {
        $medias = [
            'lg' => 1140,
            'md' => 940,
            'sm' => 720,
            'xs' => 480,
        ];

        $filterSets = [];

        foreach ($medias as $size => $width) {
            for ($column = 1; $column <= 12; $column++) {
                $number = 12 / $column;

                $filterSets[sprintf('col_%s_%d', $size, $column)] = [
                    'cache'           => 'local_media',
                    'data_loader'     => 'local_media',
                    'filters'         => [
                        'relative_resize' => ['widen' => round(($width - ($number - 1) * 30) / $number)],
                    ],
                    'post_processors' => [
                        'jpegoptim' => ['strip_all' => true, 'max' => "%image.jpeg_quality%", 'progressive' => true],
                        'pngquant'  => ['quality' => "%image.png_quality%"],
                    ],
                ];
            }
        }

        $container->prependExtensionConfig('liip_imagine', [
            'filter_sets' => $filterSets,
        ]);
    }
private function registerImageFilters ( ContainerBuilder $ container ) { $ medias = [ 'lg' => 1140 , 'md' => 940 , 'sm' => 720 , 'xs' => 480 , ] ; $ filterSets = [ ] ; foreach ( $ medias as $ size => $ width ) { for ( $ column = 1 ; $ column <= 12 ; $ column ++ ) { $ number = 12 / $ column ; $ filterSets [ sprintf ( 'col_%s_%d' , $ size , $ column ) ] = [ 'cache' => 'local_media' , 'data_loader' => 'local_media' , 'filters' => [ 'relative_resize' => [ 'widen' => round ( ( $ width - ( $ number - 1 ) * 30 ) / $ number ) ] , ] , 'post_processors' => [ 'jpegoptim' => [ 'strip_all' => true , 'max' => "%image.jpeg_quality%" , 'progressive' => true ] , 'pngquant' => [ 'quality' => "%image.png_quality%" ] , ] , ] ; } } $ container -> prependExtensionConfig ( 'liip_imagine' , [ 'filter_sets' => $ filterSets , ] ) ; }
Registers the image filters for the cms editor.

@param ContainerBuilder $container
Registers the image filters for the cms editor .