PHPackages                             leroy/liip-imagine-entity-annotation-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. leroy/liip-imagine-entity-annotation-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

leroy/liip-imagine-entity-annotation-bundle
===========================================

Easily manage your liip imagine filter with entities

0.1.0(3y ago)1133MITPHPPHP &gt;=7.4

Since Oct 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/GuillaumeLe/LiipImagineEntityAnnotationBundle)[ Packagist](https://packagist.org/packages/leroy/liip-imagine-entity-annotation-bundle)[ RSS](/packages/leroy-liip-imagine-entity-annotation-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

LiipImagine Entity Annotation Bundle
====================================

[](#liipimagine-entity-annotation-bundle)

LiipImagineEntityAnnotationBundle has been design the make easier the usage of [LiipImagineBundle](https://github.com/liip/LiipImagineBundle) filter with Entity classes.

It's compatible with:

- [VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle)

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require leroy/liip-imagine-entity-annotation-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require leroy/liip-imagine-entity-annotation-bundle
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Leroy\LiipImagineEntityAnnotationBundle\LiipImagineEntityAnnotationBundle::class => ['all' => true],
];
```

Usage
=====

[](#usage)

Given the following filter config:

```
liip_imagine:
    # valid drivers options include "gd" or "gmagick" or "imagick"
    driver: "gd"
    resolvers :
        default :
            web_path : ~
    filter_sets :
        cache : ~

        # the name of the "filter set"
        my_thumb :

            # adjust the image quality to 75%
            quality : 75

            # list of transformations to apply (the "filters")
            filters :

                # create a thumbnail: set size to 120x90 and use the "outbound" mode
                # to crop the image when the size ratio of the input differs
                thumbnail  : { size : [120, 90], mode : outbound }

                # create a 2px black border: center the thumbnail on a black background
                # 4px larger to create a 2px border around the final image
                background : { size : [124, 94], position : center, color : '#000000' }
```

### Basic (the original image path is store in a property)

[](#basic-the-original-image-path-is-store-in-a-property)

If the original image path is directly accessible in a property of your entity:

```
