symfony - imagine_filter() not generating the correct url in LiipImagineBundle -
i think there bug in bundle liipimaginebundle. explain:
here new config of bundle:
liip_imagine: resolvers: default: web_path: web_root: %kernel.root_dir%/../web/img # %kernel.root_dir%/../web/img folder filtered images created! cache_prefix: media/cache # media/cache prefix of folder cached images created filter_sets: cache: ~ my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound }
this twig part displaying image:
{# way filtered image not created!#} <img src="{{ 'img/test.jpg' | imagine_filter('my_thumb') }}" /> {# way, filted images created. asset() must used. #} <img src="{{ asset('img/test.jpg' | imagine_filter('my_thumb')) }}" />
the generated link of image not correct! in fact, obtained link is:
http://localhost/media/cache/my_thumb/img/test.jpg
the expected correct link is:
http://localhost/tuto/web/img/media/cache/my_thumb/img/test.jpg
there missing part in url: tuto/web/img . bug?
to avoid problem, did this:
<img src="{{ asset('img/test.jpg' | imagine_filter('my_thumb'))|replace({'media':'tuto/web/img/media'}) }}" />
i guess playing twig not solution.
it bug in liipimaginebundle? if not, please give correct config bundle!
thanks!
i found solution on github.
Comments
Post a Comment