# AttachmentFu Reprocess all assets

**URL:** <https://www.ruby-forum.com/t/attachmentfu-reprocess-all-assets/151570>\
**Category:** Rails\
**Created:** [October 23, 2008, 3:30am UTC](https://www.ruby-forum.com/t/attachmentfu-reprocess-all-assets/151570 "2008-10-23T03:30:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robby247365](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@robby247365](https://www.ruby-forum.com/u/robby247365)\
**Post date:** [October 23, 2008, 3:30am UTC](https://www.ruby-forum.com/t/attachmentfu-reprocess-all-assets/151570/1 "2008-10-23T03:30:02Z")

</div>

Hey all,

I am about to embark on reprocessing approx 100k user photos with new  
dimensions that a site redesign has called for. We used AttachmentFu  
and have stored the originals in case this ever came up. I don’t see  
anything built directly in AttachmenFu and was planning to write some  
rake tasks to do this myself, but figured it was worth a shot to find  
out if anybody else had to do this and wanted to share any  
pointers/code. 🙂

Thanks in advance!

Cheers,  
Robby

–  
Robby R.  
Chief Evangelist, Partner

PLANET ARGON, LLC  
design // development // hosting

> **[Planet Argon](https://www.planetargon.com/)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[http://www.robbyonrails.com/](http://www.robbyonrails.com/)  
aim: planetargon

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4068 [fax]

---

<div class="post-metadata">

**Author:** ![robby247365](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@robby247365](https://www.ruby-forum.com/u/robby247365)\
**Post date:** [October 23, 2008, 4:59am UTC](https://www.ruby-forum.com/t/attachmentfu-reprocess-all-assets/151570/2 "2008-10-23T04:59:01Z")

</div>

Hi Robbie-

> I am about to embark on reprocessing approx 100k user photos with new  
> dimensions that a site redesign has called for. We used AttachmentFu  
> and have stored the originals in case this ever came up. I don’t see  
> anything built directly in AttachmenFu and was planning to write some  
> rake tasks to do this myself, but figured it was worth a shot to find  
> out if anybody else had to do this and wanted to share any  
> pointers/code. 🙂

Your post at  
[http://www.robbyonrails.com/articles/2008/06/20/ruby-1-8-7-on-macports-causing-some-problems](http://www.robbyonrails.com/articles/2008/06/20/ruby-1-8-7-on-macports-causing-some-problems)  
saved my ass a few days ago, when I was setting up a new Macbook Pro.  
So, now, I’m really happy to have the chance to pay you back 🙂

We faced the same situation as you (though with fewer than 100K images,  
I must say), and I wrote code to rehash all the existing images to the  
new thumbnail sizes. You’ll find it at [http://pastie.org/298645](http://pastie.org/298645).

In our case, we were using S3 for image storage, and I had to insert the  
sleep at line 12 to avoid freaking S3 out, but, if you’re using local  
file storage, it shouldn’t be necessary.

Hope that helps-

Danny  
[http://rejaw.com/help/about#danny](http://rejaw.com/help/about#danny)

---

<div class="post-metadata">

**Author:** ![robby247365](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@robby247365](https://www.ruby-forum.com/u/robby247365)\
**Post date:** [October 23, 2008, 6:25am UTC](https://www.ruby-forum.com/t/attachmentfu-reprocess-all-assets/151570/3 "2008-10-23T06:25:00Z")

</div>

On Wed, Oct 22, 2008 at 7:59 PM, Danny B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> Your post at  
> [http://www.robbyonrails.com/articles/2008/06/20/ruby-1-8-7-on-macports-causing-some-problems](http://www.robbyonrails.com/articles/2008/06/20/ruby-1-8-7-on-macports-causing-some-problems)  
> saved my ass a few days ago, when I was setting up a new Macbook Pro.

Glad to hear that my post helped you. 🙂

> So, now, I’m really happy to have the chance to pay you back 🙂

Awesome!

> We faced the same situation as you (though with fewer than 100K images,  
> I must say), and I wrote code to rehash all the existing images to the  
> new thumbnail sizes. You’ll find it at [http://pastie.org/298645](http://pastie.org/298645).
> 
> In our case, we were using S3 for image storage, and I had to insert the  
> sleep at line 12 to avoid freaking S3 out, but, if you’re using local  
> file storage, it shouldn’t be necessary.
> 
> Hope that helps-

This works great. Just tested it out and it works perfectly. Now to  
get ready to start reprocessing 100x x 7 variants… 700k photos!

Thanks again!

Cheers,  
Robby

–  
Robby R.  
Chief Evangelist, Partner

PLANET ARGON, LLC  
design // development // hosting

> **[Planet Argon](https://www.planetargon.com/)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[http://www.robbyonrails.com/](http://www.robbyonrails.com/)  
aim: planetargon

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4068 [fax]
