# Attachment\_fu not saving thumbnails

**URL:** <https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018>\
**Category:** Rails\
**Created:** [April 26, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018 "2007-04-26T17:52:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 26, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/1 "2007-04-26T17:52:01Z")

</div>

hi  
attachment\_fu is not saving thumbnails, nor parent\_id or width or  
height in the database.  
any ideas why? using minimagick

class Mugshots \< ActiveRecord::Base

has\_attachment :processor =\> :mini\_magick,  
:content\_type =\> :image,  
:storage =\> :file\_system,  
:max\_size =\> 5000.kilobytes,  
:resize\_to =\> ‘320x200\>’,  
:thumbnails =\> { :thumb =\> ‘100x100\>’ }

validates\_as\_attachment

end

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 27, 2007, 2:51pm UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/2 "2007-04-27T14:51:10Z")

</div>

hello,  
i have the same problem. the file is created of Zero byte.

please tell me the solution…

Thanks

Arun

On 26/04/07, mr\_robot [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> :content\_type =\> :image,
> 
> >

–  
Arun A.

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 28, 2007, 3:49pm UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/3 "2007-04-28T15:49:23Z")

</div>

Could you post your migration?

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 30, 2007, 6:00am UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/4 "2007-04-30T06:00:04Z")

</div>

> filename, content\_type and size gets saved into database,  
> but no parent\_id or width or height or thumbnail
> 
> banging my head agaist this one. googling have seen a couple of people  
> with same issue, but haven’t heard of anyone resolving it. any ideas?

You need either rmagick, minimagick, or image science if you want them  
to create thumbnails.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 30, 2007, 10:47am UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/5 "2007-04-30T10:47:18Z")

</div>

hi rick  
yea, mini\_magick is installed as plugin.  
and when i check through terminal i can see it. and when  
using :processor =\> :mini\_magick  
it doesn’t work.  
same as if i use rmagick, which i know is 100% working - because it  
works with filecolumn

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [April 30, 2007, 5:22am UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/6 "2007-04-30T05:22:03Z")

</div>

i followed mike clark’s tutorial

class CreateMugshots \< ActiveRecord::Migration

def self.up  
create\_table :mugshots do |t|  
t.column :parent\_id, :integer  
t.column :content\_type, :string  
t.column :filename, :string  
t.column :thumbnail, :string  
t.column :size, :integer  
t.column :width, :integer  
t.column :height, :integer  
end  
end

def self.down  
drop\_table :mugshots  
end  
end

the only difference is i’m using image\_magick in my model - don’t want  
to use imagescience - because rmagick kills dreamhost shared servers.

so here’s the model:

class Mugshot \< ActiveRecord::Base

has\_attachment :content\_type =\> :image,  
:storage =\> :file\_system,  
:max\_size =\> 5000.kilobytes,  
:resize\_to =\> ‘320x200\>’,  
:processor =\> :mini\_magick,  
:thumbnails =\> { :thumb =\> ‘100x100\>’ }

validates\_as\_attachment

end

filename, content\_type and size gets saved into database,  
but no parent\_id or width or height or thumbnail

banging my head agaist this one. googling have seen a couple of people  
with same issue, but haven’t heard of anyone resolving it. any ideas?

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [May 1, 2007, 7:03am UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/7 "2007-05-01T07:03:27Z")

</div>

yes, it does seem to be minimagick that is causing the problems. if i  
use rmagick the image details get saved in.  
but tried both the minimagick gem and the plugin, and no luck.

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [May 1, 2007, 4:34am UTC](https://www.ruby-forum.com/t/attachment-fu-not-saving-thumbnails/93018/8 "2007-05-01T04:34:18Z")

</div>

hmmmmm…not sure how well the mini\_magick plugin works.  
Maybe you should try installing the latest version of mini\_magick as a  
gem ?
