I have the below code in my twig template which works just fine in development and displays all the images in the directory as I would expect:
{% image '@AppBundle/Resources/images/designz/*' %}
<img src="{{ asset_url }}" width="600" />
{% endimage %}
However, when I move the site to the production environment I do not get any of the images appearing. I have tried submitting the below commands in the hope of fixing it but with no luck:
php app/console assetic:dump --env=prod --no-debug
php app/console cache:clear --env=prod --no-debug
php app/console assets:install
I have tested your case in my project. And i think that *
isn't working for an image file. In dev mode Symfony make more image tags in production mode Symfony try to merge that files to one output file and that isn't normally not working for image files because you have some meta data for example. If you have some different files in that folder for example png and jpeg you try to merge them.
This function is correct if you use filter and pipe that result to an output.
Production:
<img src="/images/925f36b.png" width="600">
Dev:
<img src="/app_dev.php/images/925f36b_part_1_hellgrau_1.png" width="600">
<img src="/app_dev.php/images/925f36b_part_1_xxx_2.png" width="600">
But finally i think with images you can use only one file.