I am trying to apply a filter on an image based on LiipImagineBundle.
Here are the steps:
Installation through the composer file by adding this line:
"liip/imagine-bundle": "1.0.*@dev"
Configuration of the config.yml file by adding these lines:
liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web cache_prefix: media/cache filter_sets: cache: ~ my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound }
Declaration of the bundle in AppKernel.php:
new Liip\ImagineBundle\LiipImagineBundle(),
Testing the bundle by adding there line the twig file:
<img src="{{ asset('img/test.jpg') | imagine_filter('my_thumb') }}" />
But, no image was displayed. The generated HTML file contains:
<img src="http://localhost/tuto/web/app_dev.php/media/cache/my_thumb/img/test.jpg">
And in the javascript console of the browser, I find this error:
GET http://localhost/tuto/web/app_dev.php/media/cache/my_thumb/img/test.jpg 500 (Internal Server Error)
When I try to open the link (with the 500 Internal Server Error), symfony throws this error:
Failed to create /home/amine/NetBeansProjects/tuto/app/../web/media/cache/my_thumb/img
500 Internal Server Error - IOException
I guess I do not have the permission to create the following folder: /home/amine/NetBeansProjects/tuto/app/../web/media/cache/my_thumb/img
. In my point of view, it was expectable since I working on Ubuntu.
To avoid this problem, I directly changed the permissions on the folder web
through sudo chmod 777 -R web
but the problem is still the same.
Is there any idea?