<p>I wrote a plugin called <a href="https://github.com/mmikkel/RetconHTML-Craft" rel="nofollow">Retcon</a> which is able to apply <a href="https://github.com/mmikkel/RetconHTML-Craft/wiki/Transform" rel="nofollow">bulk image transforms</a> to images in HTML/Redactor content:</p>

<pre><code>{{ entry.body|retconTransform({ width : 1024 }) }}
{{ entry.body|retconTransform(myAwesomeTransform) }}
</code></pre>

<p>There's currently no way to tell Retcon to only transform images that hasn't already been transformed, though – so this might not be exactly what you're looking for.</p>

CC BY-SA 3.0
2016-07-24T23:05:58.537Z
Very nice, thanks Mats. Apologies for the late reply too!
Mark Notton
CC BY-SA 3.0
2016-05-19T12:11:15.360Z
2016-05-19T12:11:15.360Z
Mats Mikkel Rummelhoff
<p>I know <a href="https://craftcms.stackexchange.com/questions/8271/apply-transform-to-image-uploaded-into-redactor">this essentially does the trick</a>, however I was hoping I could apply a custom transform to all image assets if one <strong>hasn't</strong> been defined by the user. </p>

<p>The problem I have is trying to convey the importance of defining image transforms to my "less-than-savvi" clients. </p>

<p>So, as a fallback I'd like to know if I can query any images and apply an image transform. I feel like this might be a step in the right direction, but not sure what to do next:</p>

<pre><code>{{ include(template_from_string(entry.body)|raw) }}
</code></pre>

<p>Cheers.</p>

<image-transforms>
Force an image transform to images inserted into Redactor
# Force an image transform to images inserted into Redactor

(Asked by: username_0 on 2016-05-19)

I know this essentially does the trick, however I was hoping I could apply a custom transform to all image assets if one hasn't been defined by the user. 
The problem I have is trying to convey the importance of defining image transforms to my "less-than-savvi" clients. 
So, as a fallback I'd like to know if I can query any images and apply an image transform. I feel like this might be a step in the right direction, but not sure what to do next:
{{ include(template_from_string(entry.body)|raw) }}

Cheers.

**Tags:** image-transforms

---

## 1 answers

### Answer by username_1 on 2016-05-19. Score: 3 | Accepted answer

I wrote a plugin called Retcon which is able to apply bulk image transforms to images in HTML/Redactor content:
{{ entry.body|retconTransform({ width : 1024 }) }}
{{ entry.body|retconTransform(myAwesomeTransform) }}

There's currently no way to tell Retcon to only transform images that hasn't already been transformed, though – so this might not be exactly what you're looking for.

> **Comments:**
> **username_0**: Very nice, thanks Mats. Apologies for the late reply too!  

---

