문제

I've installed LiipImagineBundle to Symfony 2 using this method - Installing and running LiipImagineBundle in symfony 2.1

I've done everything it asks and it initially creates the thumbnail image, however if I change the image dimensions in config.yml the image doesn't change!

I've tried clearing the cache using app/console cache:clear but I get the following error:

[Symfony\Component\Filesystem\Exception\IOException]                                                          
Failed to remove file /localhost/path/web//media/cache/my_thumb/media/test.jpg

Here is what my twig template looks like:

<img src="{{ asset(entity.filename) | imagine_filter('my_thumb') }}" /> 

It looks as though it can't remove the image in order to generate the new one, any ideas?

UPDATE:

Here is my routing file:

# app/config/routing.yml
_imagine:
resource: .
type:     imagine

Here is my config file:

# app/config/config.yml
  liip_imagine:
  filter_sets:
     my_thumb:
        quality: 75
        filters:
           thumbnail: { size: [120, 90], mode: outbound }
도움이 되었습니까?

해결책

Try to apply the same permissions to your image directory as you did with the app/logs and app/cache folders.

You should then be able to clear the cache without any errors.
I haven't used the LiipImagineBundle yet, but i think it's best to clear the cache after each change to the dimensions, otherwise the bundle would have to check if the image was changed on each request (which defeats the purpose of caching)!

Hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top