Gregwar's ImageBundle ===================== `GregwarImageBundle` provides easy Image manipulation and API for Symfony2 and Twig Installation ============ ### Step 1: Download the GregwarImageBundle ***Using the vendors script*** Add the following lines to your `deps` file: ``` [GregwarImageBundle] git=http://github.com/Gregwar/ImageBundle.git target=/bundles/Gregwar/ImageBundle ``` Now, run the vendors script to download the bundle: ``` bash $ php bin/vendors install ``` ***Using submodules*** If you prefer instead to use git submodules, then run the following: ``` bash $ git submodule add git://github.com/Gregwar/ImageBundle.git vendor/bundles/Gregwar/ImageBundle $ git submodule update --init ``` ***Using Composer*** Add the following to the "require" section of your `composer.json` file: ``` "gregwar/image-bundle": "dev-master" ``` You can also choose a version number, (tag, commit ...) And update your dependencies ``` php composer.phar update ``` ### Step 2: Configure the Autoloader If you use composer, you can skip this step. Add it to your `autoload.pp` : ```php __DIR__.'/../vendor/bundles', ``` ### Step 3: Enable the bundle Registers the bundle in your `app/AppKernel.php`: ```php And that's all ! The helper will automatically create the cached file on-the-fly if it doesn't exists yet. The available methods are the same as the [Gregwar's Image](http://github.com/Gregwar/Image). Using Image API --------------- The image instance provides also a simple API, you can call some methods to get informations about the handled image: Image width: {{ image('linux.jpg').width }}px Manipulating Image in Controllers --------------------------------- The Image Handler is accessible via a service called image.handling. So you can do in your controllers: ```php get('image.handling')->open('linux.jpg') ->grayscale() ->rotate(12) ->save('out.jpg') ``` Requirements ============ `GregwarImageBundle` needs [GD](http://php.net/gd) and [exif](http://php.net/exif) extension for PHP to be installed on the web server License ======= This bundle is under MIT license