search

Home  >  Q&A  >  body text

I have a question about liip Imagine

I'm using symfony 5.4 and I just need to install the liip Imagine package to manipulate my images. However, after configuring everything, no images appear in my browser and when I check, I get my code and the following error message: http://localhost:8000/media/cache/resolve /my_thumb/images /properties/629a464aa81ef086062845.jpg 404 (Not Found)

In my project I don't even have any autogenerated directory for media/cache/..... in the images directory.

This is the content of my liip_imagine.yaml file:

# Documentation on how to configure the bundle can be found at: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html
liip_imagine:
    # valid drivers options include "gd" or "gmagick" or "imagick"
    driver: "gd"

    filter_sets:
        cache: ~
        my_thumb:
            quality: 75
            filters:
                thumbnails: {size: [360, 230], mode: outbound}

This is what I wrote in my twig file:

<img src="{{ vich_uploader_asset(property, 'imageFile') | imagine_filter('my_thumb') }}" class="card-img-top" alt="">

Please I need help, I tried several tricks like adding parser and loader but none of them solved my problem

P粉021553460P粉021553460252 days ago352

reply all(1)I'll reply

  • P粉649990163

    P粉6499901632024-03-20 17:50:15

    Also use this setting in the configuration file

    resolvers:
        default:
            web_path:
                web_root: ~ # %kernel.project_dir%/public (%kernel.project_dir%/web for Symfony < 4.0.0)
                cache_prefix: ~ # media/cache

    Where are your files generated? You have to add a symbolic link to the uploaded image path using the public/../media/cache folder and then you will see the image in your browser

    reply
    0
  • Cancelreply