Reputation: 31
I use symfony 5.4 and I just install the package liip imagine to manipulate my images. However after configuring everything, I don't have any image appearing in my browser and when I inspect, I get my code, I get the following error message: http://localhost:8000/media/cache/resolve/my_thumb/images/properties/629a464aa81ef086062845.jpg 404 (Not Found)
in my project, I even don't have any directory auto-generated 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}
and this is what I've 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've tried several tricks like adding resolver and loaders but none of them solved my problem
Upvotes: 1
Views: 1025
Reputation: 532
Use this setting also in config 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 your files are generated? You have to add symlink for uploaded image path with public/../media/cache folder then you will see images in browser
Upvotes: 1