<p>You could just make a temporary template that makes Craft generate them for you. And depending on how many these are, you better use <code>limit</code> and <code>offset</code> with your <code>craft.assets</code> call.</p>

<pre><code>{% set images = craft.assets.source('myAssetSource').limit(50).offset(0) %}
{% for image in images %}
    &lt;img src="{{ image.url('fullwidth') }}"&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-02-12T19:07:10.507Z
2015-02-12T19:07:10.507Z
carlcs
<p>I imported all of the posts from a WordPress blog, using a regular expression to update the image URLs to their new location in a Craft Asset Source. However, many of the original photos are straight out of the camera - 2000x3000px or whatever. What I would like to do is use that same regex to update them to a transformed version: so /wp-content/uploads/2014/12/photo.jpg would become /media/blog/_fullWidth/photo.jpg. I already set up that replacement and it's working great. </p>

<p>The problem is that the "Full Width" transform hasn't been generated, and just calling the URL from a Rich Text field bypasses Craft, so it never gets generated. Short of manually re-adding every photo through Redactor with the transform, is there any way to force Craft to generate a particular transform on all the images in an asset source? </p>

CC BY-SA 3.0
2015-02-12T18:52:56.857Z
Might be easier (and less processor intensive) in the long run to just download all the images, run them through photoshops 'File>Scripts>Image Processor' in a batch, re-upload them, and update the assets index.
Douglas McDonald
CC BY-SA 3.0
2015-02-12T19:01:30.200Z
+1 for Douglas's suggestion. Running all of that through PHP/GD/Imagick is going to be a headache.
Brad Bell
<assets><image-transforms><import>
Any way to manually generate a transform on an asset source?
# Any way to manually generate a transform on an asset source?

(Asked by: username_0 on 2015-02-12)

I imported all of the posts from a WordPress blog, using a regular expression to update the image URLs to their new location in a Craft Asset Source. However, many of the original photos are straight out of the camera - 2000x3000px or whatever. What I would like to do is use that same regex to update them to a transformed version: so /wp-content/uploads/2014/12/photo.jpg would become /media/blog/\_fullWidth/photo.jpg. I already set up that replacement and it's working great.

The problem is that the "Full Width" transform hasn't been generated, and just calling the URL from a Rich Text field bypasses Craft, so it never gets generated. Short of manually re-adding every photo through Redactor with the transform, is there any way to force Craft to generate a particular transform on all the images in an asset source?

**Tags:** assets, image-transforms, import

> **Comments:**
> **username_1**: Might be easier (and less processor intensive) in the long run to just download all the images, run them through photoshops 'File>Scripts>Image Processor' in a batch, re-upload them, and update the assets index.  
> **username_2**: +1 for Douglas's suggestion. Running all of that through PHP/GD/Imagick is going to be a headache.  

---

## 1 answers

### Answer by username_3 on 2015-02-12. Score: 2 | Accepted answer

You could just make a temporary template that makes Craft generate them for you. And depending on how many these are, you better use limit and offset with your craft.assets call.
{% set images = craft.assets.source('myAssetSource').limit(50).offset(0) %}
{% for image in images %}
    
{% endfor %}


---

