Skip to content

Commit

Permalink
Merge pull request ezsystems#1300 from Plopix/patch-4
Browse files Browse the repository at this point in the history
Fix EZP-24535: Avoid empty width/height and allow to force them
  • Loading branch information
yannickroger committed Jun 30, 2015
2 parents 8dee4f2 + 39d4f4a commit 06c571d
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -409,7 +409,10 @@
{% if not ez_is_field_empty( content, field ) %}
<figure {{ block( 'field_attributes' ) }}>
{% set imageAlias = ez_image_alias( field, versionInfo, parameters.alias|default( 'original' ) ) %}
<img src="{% if imageAlias %}{{ asset( imageAlias.uri ) }}{% else %}//:0{% endif %}"{% if imageAlias.width is defined %} width="{{ imageAlias.width }}"{% endif %}{% if imageAlias.height is defined %} height="{{ imageAlias.height }}"{% endif %} alt="{{ field.value.alternativeText }}" />
{% set src = imageAlias ? asset( imageAlias.uri ) : "//:0" %}
{% set width = parameters.width is defined ? parameters.width : imageAlias.width %}
{% set height = parameters.height is defined ? parameters.height : imageAlias.height %}
<img src="{{ src }}"{% if width %} width="{{ width }}"{% endif %}{% if height %} height="{{ height }}"{% endif %} alt="{{ field.value.alternativeText }}" />
</figure>
{% endif %}
{% endspaceless %}
Expand Down

0 comments on commit 06c571d

Please sign in to comment.