<pre><code>{% if image.extension == 'svg' %}
  &lt;img src=&quot;{{ image.url }}&quot; ... /&gt;
{% else %}
  ...
{% endif %}
</code></pre>

CC BY-SA 4.0
2023-06-30T14:29:22.930Z
2023-06-30T14:29:22.930Z
Matt Wilcox
<pre><code> {% for icon in icons %}
                    {% set image = icon.icon.one() ?? null %}
                    {% if image %}
                        &lt;div class=&quot;c c-md-6 c-lg-6&quot;&gt;
                            &lt;div class=&quot;icon&quot;&gt;
                                &lt;div class=&quot;image&quot;&gt;
                                    &lt;figure&gt;
                                        &lt;img src=&quot;{{ image.getUrl('medium') }}&quot; sizes=&quot;100vw&quot; srcset=&quot;{{ image.getUrl('small') }} 320w, {{ image.getUrl('medium') }} 640w&quot; alt=&quot;{{ image.title }}&quot;&gt;
                                        &lt;figcaption&gt;{{ icon.title }}&lt;/figcaption&gt;
                                    &lt;/figure&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    {% endif %}
                {% endfor %}
</code></pre>

<templating><image-transforms><svg>
I'm trying to remove transforms if my image is an svg? Any tips or advice would be great
# I'm trying to remove transforms if my image is an svg? Any tips or advice would be great

(Asked by: username_0 on 2023-06-30)

{% for icon in icons %}
                    {% set image = icon.icon.one() ?? null %}
                    {% if image %}
                        
                            
                                
                                    
                                        
                                        {{ icon.title }}
                                    
                                
                            
                        
                    {% endif %}
                {% endfor %}

**Tags:** templating, image-transforms, svg


---

## 1 answers

### Answer by username_1 on 2023-06-30. Score: 2 | Accepted answer

{% if image.extension == 'svg' %}
  
{% else %}
  ...
{% endif %}


---

