# Another attachment\_fu on Windows problem

**URL:** <https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806>\
**Category:** Rails\
**Created:** [July 22, 2008, 10:57pm UTC](https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806 "2008-07-22T22:57:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brian](https://www.ruby-forum.com/u/brian)\
**Post date:** [July 22, 2008, 10:57pm UTC](https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806/1 "2008-07-22T22:57:40Z")

</div>

I’ve started from Mike C.'s tutorial as well. The base image gets  
saved fine, but the thumbnails don’t get created and the resizing is  
not working either.

I’ve read the following thread about this:

[http://groups.google.com/group/rubyonrails-talk/browse\_frm/thread/2150d2ebe267545a/15018dcf54d5ff7b?lnk=gst&q=attachment\_fu+windows#15018dcf54d5ff7b](http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/2150d2ebe267545a/15018dcf54d5ff7b?lnk=gst&q=attachment_fu+windows#15018dcf54d5ff7b)

But it seems like my problem is slightly different, because the size  
attribute is NOT zero. At least not in the database. Maybe I’m  
misunderstanding the problem, and the error is with a file size = 0  
earlier in the process, even though it eventually gets saved with the  
right value.

I’m using ImageScience as recommended. I noticed in the AFU Readme  
that the :resize\_to option specifically mentions RMagick. Does  
resizing only work with RMagick?

Other threads talk about making sure your model has a parent\_id  
column. My model does have parent\_id, but I found another thread on  
this problem (which I’ve lost now) where they had to modify AFU to set  
the thumbnail.parent\_id because of a change in the arguments passed to  
a certain method, like a post-save method, something like that.

I’m using InstantRails2 on WinXP. I’m pretty much a rails newb, so I  
could be missing or screwing up very basic stuff

Would appreciate any help, thanks

---

<div class="post-metadata">

**Author:** ![brian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brian](https://www.ruby-forum.com/u/brian)\
**Post date:** [July 23, 2008, 4:28pm UTC](https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806/2 "2008-07-23T16:28:37Z")

</div>

bumping for new looks in the morning, please help

---

<div class="post-metadata">

**Author:** ![brian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brian](https://www.ruby-forum.com/u/brian)\
**Post date:** [July 23, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806/3 "2008-07-23T17:03:53Z")

</div>

On 23 Jul 2008, at 16:27, Brian wrote:

> bumping for new looks in the morning, please help
> 
> On Jul 22, 4:56 pm, Brian [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’ve started from Mike C.'s tutorial as well. The base image gets  
> > saved fine, but the thumbnails don’t get created and the resizing is  
> > not working either.

Follow this procedure to find the cause, then google for the correct  
solution:

â€¢ After uploading an image file, check the database and look if the  
content\_type column is image/jpeg, image/png, â€¦  
=\> Yes, check out option 2  
=\> No, it’s application/octet-stream: you are probably using  
SWFUpload or a Flash uploader, they don’t pass in the correct mime  
type. The easiest way is to patch attachment\_fu’s uploaded\_data=  
method to try and determine the content type if it’s application/octet-  
stream  
â€¢ ImageScience or its dependencies aren’t installed properly,  
reinstall them.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![brian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@brian](https://www.ruby-forum.com/u/brian)\
**Post date:** [July 23, 2008, 8:02pm UTC](https://www.ruby-forum.com/t/another-attachment-fu-on-windows-problem/143806/4 "2008-07-23T20:02:26Z")

</div>

Thanks for the reply. The content\_type is ‘image/pjpeg’, not ‘image/  
jpeg’. Am I being nit-picky, or does that indicate a problem?

Also, down the road I’ll probably end up using a host like DreamHost.  
I think they use RMagick. In that case should I just get it working  
with Rmagick instead of ImageScience?
