Skip to content

Commit

Permalink
do not try to make thumbnails for svg images on media detail pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristof Jochmans committed Aug 20, 2014
1 parent 80ed4e1 commit f09ffc5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Resources/views/Media/Image/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@
{% endblock %}

{% block preview %}
<p><img id="editimage" class="thumbnail" src="{{ handler.getImageUrl(media, app.request.basePath) | imagine_filter('media_detail_thumbnail') }}" alt="{{ media.name }}" /></p>
{% set imageurl = handler.getImageUrl(media, app.request.basePath) %}
{% if imageurl is not empty and media.location == 'local' %}
{% if imageurl|lower|split('.')|last == 'svg' or 'image/svg' in media.contentType %}
{% set imageurl = imageurl %}
{% else %}
{% set imageurl = imageurl | imagine_filter('media_detail_thumbnail') %}
{% endif %}
{% endif %}
<p><img id="editimage" class="thumbnail" src="{{ imageurl }}" alt="{{ media.name }}" /></p>
{% endblock %}

0 comments on commit f09ffc5

Please sign in to comment.