In your controller do
return $this->render( 'assetic' => array( 'vars' => array( 'height' => '300px', 'width' => '400px' ) );
Then in your template branch
{% image vars=['height', 'width'] output='/images/foo.jpg?{height}x{width}' '@MyBundle/Resources/public/images/bar.jpg' %} <img src="{{ asset(asset_url) }}" alt="Something" height="{{assetic.vars.height}}" width="{{assetic.vars.width}}"> {% endimage %}
The only limitation / problem with this approach is that you need to include dynamic variables (height and width) in the output URL.
Let us know how it happened.
Hello,
source share