itf / vich-imagine-bundle
Easy integration of VichUploaderBundle (upload) and LiipImagineBundle (processor)
0.1.4
2016-03-21 10:28 UTC
Requires
- php: >=5.3
- liip/imagine-bundle: ^1.3
- symfony/symfony: ^2.7
- vich/uploader-bundle: ^0.14.0
This package is not auto-updated.
Last update: 2024-10-26 18:28:10 UTC
README
This bundle integrates VichUploaderBundle as uploader and LiipImagineBundle as processor (resize etc.) component.
Installation
composer require itf/vich-imagine-bundle "dev-master"
php app/console assets:install
Activate the bundles in AppKernel.php:
public function registerBundles() { $bundles = array( //[...] new Liip\ImagineBundle\LiipImagineBundle(), new Vich\UploaderBundle\VichUploaderBundle(), new VichImagineBundle\VichImagineBundle(), ), // ... }
Configure VichUploaderBundle
Refer to its documentation to configure this bundle. Here's an example:
vich_uploader: db_driver: orm # or mongodb or propel or phpcr mappings: product_image: uri_prefix: /images/products upload_destination: %kernel.root_dir%/../web/images/products namer: vich.custom.random_namer
Configure LiipImagineBundle
Refer to its documentation to configure this bundle. Here's an example:
liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: cache/ loaders: default: filesystem: data_root: %kernel.root_dir%/../web/ driver: gd cache: default data_loader: default default_image: null controller: filter_action: liip_imagine.controller:filterAction filter_runtime_action: liip_imagine.controller:filterRuntimeAction filter_sets: product_image: filters: jpeg_quality: 75 #png_compression_level: ~ format: jpg relative_resize: { widen: 800 }
Configuration Example
- Configuration example: config_sample.yml
- Entity example: Image.php
- FormType example: ImageType.php
That's it.
License
MIT