Here are the steps I followed:
Added following in my composer.json:
"require": {
"imagine/Imagine": ">=0.2.8",
"liip/imagine-bundle": "*@dev",
....
}
Ran following command at command line:
composer update
Installing imagine/imagine (v0.4.0)
Installing liip/imagine-bundle (dev-master f7d5e4d)
After composer update my directory structure inside vendor folder looks like as below:
Then update vendor/composer/autoload_namespaces.php
'Imagine' => $vendorDir .'/imagine/Imagine/lib/',
'Liip\\ImagineBundle'=>$vendorDir . '/liip/imagine-bundle/',
Registered bundle:
new Liip\ImagineBundle\LiipImagineBundle(),
Routing:
# app/config/routing.yml
_imagine:
resource: .
type: imagine
config.yml
# app/config/config.yml
liip_imagine:
filter_sets:
my_thumb:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
Added to twig template file:
<img src="{{ asset('bundles/acmedemo/images/1.jpg') | imagine_filter('my_thumb') }}" />
Open localhost/symfony/web/app_dev.php/demo/hello/test
There was no thumbnail image generation. When viewing the source I found the line:
<img src="/symfony/web/app_dev.php/media/cache/my_thumb/symfony/web/bundles/acmedemo/images/1.jpg">
What I did I miss? Could somebody help me with this? I am using xampp 1.8 on windows xp with default settings
When I replaced
<img src="{{ asset('bundles/acmedemo/images/1.jpg') | imagine_filter('my_thumb') }}" />
with
<img src="{{ 'bundles/acmedemo/images/1.jpg' | imagine_filter('my_thumb') }}" />
I got the thumbnail. I removed the asset() helper of twig and it worked but dont know how it worked.