Answers.Body: <pre><code>{% if image.extension == 'svg' %}
    &lt;img src=&quot;{{ image.url }}&quot; ... /&gt;
  {% else %}
    ...
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-30T14:29:22.930Z
Answers.LastActivityDate: 2023-06-30T14:29:22.930Z
Answers.UserDisplayName: Matt Wilcox
Body: <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>
  
Tags: <templating><image-transforms><svg>
Title: I'm trying to remove transforms if my image is an svg? Any tips or advice would be great
ThreadText: # 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 %}
                          <div class="c c-md-6 c-lg-6">
                              <div class="icon">
                                  <div class="image">
                                      <figure>
                                          <img src="{{ image.getUrl('medium') }}" sizes="100vw" srcset="{{ image.getUrl('small') }} 320w, {{ image.getUrl('medium') }} 640w" alt="{{ image.title }}">
                                          <figcaption>{{ icon.title }}</figcaption>
                                      </figure>
                                  </div>
                              </div>
                          </div>
                      {% 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' %}
    <img src="{{ image.url }}" ... />
  {% else %}
    ...
  {% endif %}
  
  ```
  
  
  ---
  
  