Commit 812f02cf authored by gijs's avatar gijs

Show original files for gif

parent a330794f
......@@ -98,7 +98,11 @@
<img src="/static/contour/images/arrow-left-no-tail.svg" class="icon">
</div> -->
</div>
<img src="{% thumbnail image.image 1500x1500 %}" class="main-image">
{% if image.image|isGIF %}
<img src="{{ image.image.url }}" class="main-image">
{% else %}
<img src="{% thumbnail image.image 1500x1500 %}" class="main-image">
{% endif %}
{% if image.credit %}<section class="image-credit">{{ image.credit }}</section>{% endif %}
{% if image.author %}<section class="image-credit">{{ image.author }}</section>{% endif %}
</figure>
......
......@@ -54,7 +54,11 @@
<img src="/static/contour/images/arrow-left-no-tail.svg" class="icon">
</div> -->
</div>
<img src="{% thumbnail image.image 1500x1500 %}" class="main-image"/>
{% if image.image|isGIF %}
<img src="{{ image.image.url }}" class="main-image">
{% else %}
<img src="{% thumbnail image.image 1500x1500 %}" class="main-image">
{% endif %}
{% if image.credit %}<section class="image-credit">{{ image.credit }}</section>{% endif %}
{% if image.author %}<section class="image-credit">{{ image.author }}</section>{% endif %}
</figure>
......
......@@ -2,6 +2,7 @@ import re
import markdown as md
import dateutil.parser
import os.path
from django import template
from django.template.defaultfilters import stringfilter
......@@ -55,4 +56,11 @@ def isTemplateLoop(candidate):
@register.filter
def isInterbellum(candidate):
return isinstance(candidate, Interbellum)
\ No newline at end of file
return isinstance(candidate, Interbellum)
@register.filter
def isGIF(image):
if os.path.splitext(str(image.file))[1].lower() == '.gif':
return True
return False
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment