LiipImagineBundle: Thumbnails doesn't appear and are not created
Hello,
I have this problem on Symfony v2.1.11. It seems other people have this problem.
To verify it, I installed a clean version of Symfony v2.3.1 in new folder with:
php composer.phar create-project symfony/framework-standard-edition path/ 2.3.1
I made configuration, and verified it with config.php, it’s ok.
I installed LiipImagnineBundle with composer adding in composer.json:
"imagine/Imagine": "0.4.*",
"liip/imagine-bundle": "dev-master"
composer update works
I enabled LiipImagineBundle in app/AppKernel.php with:
new Liip\ImagineBundle\LiipImagineBundle(),
I configured LiipImagineBundle route in app/config/routing.yml with:
_imagine:
resource: .
type: imagine
And I configured LiipImagineBundle in app/config/config.yml with:
liip_imagine:
filter_sets:
my_thumb:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
To make a simple test I add this line in the welcome page /src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig:
<img src="{{ 'bundles/acmedemo/images/welcome-quick-tour.gif' | imagine_filter('my_thumb') }}" />
but when I go to the page the thumnail doesn’t appear. When I verify the HTML code in browser I have this:
<img src="/symfony-test/web/app_dev.php/media/cache/my_thumb/bundles/acmedemo/images/welcome-quick-tour.gif">
About the path, I already tried with or without parentheses and with or without asset() : same problem. I didn’t find interesting topics about this on stackoverflow.
I use PHP 5.4.9 on Ubuntu.
Any idea ? Many thanks.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 35 (15 by maintainers)
@herb123456 @ujhgj
I had the same problem with Nginx and custom expiry headers for URLs ending in .jpg, .png, etc… Managed to fix it by using a
try_files $uri @rewriteappline inside the location rule, so that these URLs are rewritten to app.php if the actual image file does not exist. I have written a more thorough explanation along with the complete config file over at https://wecodepixels.com/nginx-configuration-for-sylius/.