4

I'm using liipImagineBundle but I can't get it work. Everything is installed correctly, but when I try to apply a filter the resolver doesn't create the image.

<img src="{{ asset('bundles/xy/uploads/images/default/default.png') | imagine_filter('thumb_50x50') }}" />

The generated html code:

<img src="http://social.lh.com/app_dev.php/media/cache/resolve/thumb_50x50/bundles/xy/uploads/images/default/default.png">

If I open a console and call

php app/console liip:imagine:cache:resolve bundles\xy\uploads\images\default\default.png

it works fine after that, because the /media/cache/......./default.png is created now. But I don't want to call it from the console everytime I upload a picture that needs a thumbnail.

I tried to get it done from the controller with:

 $imagemanagerResponse = $this->container
    ->get('liip_imagine.controller')
        ->filterAction(
            $this->getRequest(),
            'bundles\xy\uploads\images\default\default.png',      
            'thumb_50x50'              
);

But then I get the error: Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)

It is strange, because I enabled that extension in php.ini.

Does anyone have any suggestions? Are there any other method is symfony2 to create a thumbnail of a picture?

BarneyK
  • 197
  • 2
  • 10
  • try investigating call directly in the browser the url of the generated html code and see the error message. Then check the extension enabled in the right php.ini files (no CLI) and ... check you have restarted apache. Hope this help – Matteo Feb 01 '15 at 21:02
  • I just feel lame, because I forgot about restarting apache. It's running as a service and I always forgot about that. Thanks! – BarneyK Feb 15 '15 at 13:30
  • You are welcome! Can I post the comment as answer so you can close your question? – Matteo Feb 15 '15 at 13:32

1 Answers1

2

Your code is good, try investigating by:

  1. call directly in the browser the url of the generated html code and see the error message
  2. Then check the extension enabled in the right php.ini files (no CLI) and ...
  3. check you have restarted apache.

Hope this help

Matteo
  • 32,801
  • 10
  • 89
  • 100