LiipImagine

1.3 version
Maintained Unmaintained

LiipImagine

Note

To focus our efforts onto a manageable number of packages, this package is currently not maintained. Security fixes and submitted bug fixes will still be released, but no new features should be expected. This bundle might have outdated documentation, there is no support from the CMF team and you should not expect bugs to be fixed.

If you want to help co-maintaining this package, tell us in a GitHub issue or in #symfony_cmf of the Symfony devs slack.

For LiipImagine, a data loader is included: Symfony\Cmf\Bundle\MediaBundle\Adapter\LiipImagine\CmfMediaDoctrineLoader. It will work for all image object implementing Symfony\Cmf\Bundle\MediaBundle\ImageInterface and is automatically enabled if the LiipImagineBundle is installed.

The data loader has the name: cmf_media_doctrine_phpcr.

  • YAML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    # app/config/config.yml
    liip_imagine:
        # ...
        filter_sets:
            # default filter to be used with the image preview
            image_upload_thumbnail:
                data_loader: cmf_media_doctrine_phpcr
                quality: 85
                filters:
                    thumbnail: { size: [100, 100], mode: outbound }
            # ...
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    <!-- app/config/config.xml -->
    <?xml version="1.0" encoding="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
        <config xmlns="http://example.org/dic/schema/liip_imagine">
            <!-- ... -->
            <!-- default filter to be used with the image preview -->
            <filter-set name="image_upload_thumbnail" data-loader="cmf_media_doctrine_phpcr" quality="85">
                <filter name="thumbnail" size="100,100" mode="outbound"/>
            </filter-set>
            <!-- ... -->
        </config>
    </container>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    // app/config/config.php
    $container->loadFromExtension('liip_imagine', array(
        // ...
        'filter_sets' => array(
            // default filter to be used with the image preview
            'image_upload_thumbnail' => array(
                'data_loader' => 'cmf_media_doctrine_phpcr',
                'quality'     => 85,
                'filters'     => array(
                    'thumbnail' => array(
                        'size' => array(100, 100),
                        'mode' => 'outbound',
                    ),
                ),
            ),
            // ...
        ),
    ));
    

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.