php - Produce dynamic thumbnail on-the-fly in twig with liipimaginebundle -


i'm trying use liipimaginebundle in symfony produce thumbnails on fly. url of image used thumbnail being attached entry entity, twig file calls image so:

 <img src="{{ asset('uploads/images/') ~ entry.thumbnail | imagine_filter('my_thumb') }}" /> 

and doesn't seem work. i've tried tweaking data_root attribute of liipimagine's config without success. can't seem tell liip image in web/uploads/images. source html ends looking this:

 <img src="/projects/ootn_symf/web/uploads/images/http://localhost/projects/ootn_symf/web/app_dev.php/media/cache/resolve/my_thumb/my_image.jpg" /> 

currently, liip's config following:

liip_imagine:     resolvers:        default:           web_path: ~      filter_sets:         cache: ~         my_thumb:             quality: 75             filters:                 thumbnail: { size: [120, 90], mode: outbound } 

not sure here, can me?

that result beacuse filter applies "entry.image"

try this:

<img src="{{ asset('uploads/images/' ~ entry.thumbnail)  | imagine_filter('my_thumb') }}" /> 

or:

 <img src="{{ (asset('uploads/images/') ~ entry.thumbnail) | imagine_filter('my_thumb') }}" /> 

i hope helps.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -