|
79
|
1 |
{% load static %} |
|
|
2 |
{% load thumbnail %} |
|
|
3 |
{% load egonomy_thumbnail %} |
|
|
4 |
{% with fragment.image.info.image_file as image %} |
|
|
5 |
{% if image|ratio > ratio %} |
|
|
6 |
{% thumbnail image w_size format="PNG" crop="center" as im %} |
|
|
7 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" class="sub_svg_image"/> |
|
|
8 |
<svg preserveAspectRatio="none" width="{{ im.width }}" height="{{ im.height }}" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
|
9 |
<defs> |
|
|
10 |
<clipPath id="fragment-clip{{ fragment.pk }}"> |
|
|
11 |
<path d="{{ fragment.coordinates }}" /> |
|
|
12 |
</clipPath> |
|
|
13 |
</defs> |
|
|
14 |
<image xlink:href="{{ im.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ fragment.pk }})"/> |
|
|
15 |
</svg> |
|
|
16 |
{% empty %} |
|
|
17 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="{{w_size}}" height="{{w_size}}" class="placeholder sub_svg_image" /> |
|
|
18 |
<svg preserveAspectRatio="none" width="476" height="476" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
|
19 |
<defs> |
|
|
20 |
<clipPath id="fragment-clip{{ fragment.pk }}"> |
|
|
21 |
<path d="{{ fragment.coordinates }}" /> |
|
|
22 |
</clipPath> |
|
|
23 |
</defs> |
|
|
24 |
<image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ fragment.pk }})"/> |
|
|
25 |
</svg> |
|
|
26 |
{% endthumbnail %} |
|
|
27 |
{% else %} |
|
|
28 |
{% thumbnail image h_size format="PNG" crop="center" as im %} |
|
|
29 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" class="sub_svg_image"/> |
|
|
30 |
<svg preserveAspectRatio="none" width="{{ im.width }}" height="{{ im.height }}" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
|
31 |
<defs> |
|
|
32 |
<clipPath id="fragment-clip{{ fragment.pk }}"> |
|
|
33 |
<path d="{{ fragment.coordinates }}" /> |
|
|
34 |
</clipPath> |
|
|
35 |
</defs> |
|
|
36 |
<image xlink:href="{{ im.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ fragment.pk }})"/> |
|
|
37 |
{% empty %} |
|
|
38 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="{{w_size}}" height="{{w_size}}" class="placeholder sub_svg_image" /> |
|
|
39 |
<svg preserveAspectRatio="none" width="{{w_size}}" height="{{w_size}}" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
|
40 |
<defs> |
|
|
41 |
<clipPath id="fragment-clip{{ fragment.pk }}"> |
|
|
42 |
<path d="{{ fragment.coordinates }}" /> |
|
|
43 |
</clipPath> |
|
|
44 |
</defs> |
|
|
45 |
<image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ fragment.pk }})"/> |
|
|
46 |
</svg> |
|
|
47 |
{% endthumbnail %} |
|
|
48 |
{% endif %} |
|
|
49 |
{% endwith %} |
|
|
50 |
<!--svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none"> |
|
|
51 |
<path d="{{ fragment.coordinates }}" stroke="red" stroke-width=".002" fill="red" fill-opacity=".3" /> |
|
|
52 |
</svg--> |