attachment_fu thumbnail not created

I followed the instructions on Mike Clark's weblog and everything works perfectly except the thumbnail column in my DB is alwas NULL. I'm using S3 as my storage system. Anyone else having this issue with thumbnails?

has_attachment :content_type => :image,                  :storage => :s3,                  :max_size => 500.kilobytes,                  :resize_to => '150x150>',                  :thumbnails => { :thumb => '40x40>' },                  :processor => 'Rmagick'

validates_as_attachment

I first started out with trying to use ImageScience. I followed the directions correctly on their website and within my app when I try to upload an image it shuts down mongrel/server with this error:

/Users/Bob/work/app/trunk/vendor/plugins/attachment_fu/lib/ technoweenie/attachment_fu/processors/image_science_processor.rb:14: [BUG] Bus Error ruby 1.8.4 (2005-12-24) [i686-darwin8.8.1]

Abort trap

Fair enough, I'll just try minimagick and see if that works. When I run: gem install mini_magick I get this error: ERROR: While executing gem ... (Errno::EACCES)     Permission denied - /usr/local/lib/ruby/gems/1.8/cache/ mini_magick-1.2.0.gem

So it looks like Rmagick is the only one that is working but attachment_fu is not saving thumbnails. Ideally I would like to use ImageScience but I cannot spend all day working on this image upload problem. Anyone know what I'm doing wrong?

Anyone know why the thumbnails are not being created while everything else is working fine?

Hello,

try installing mini_magick again but put a sudo in front:

sudo gem install mini_magick

are you on a mac ?

I assume you are trying to install it locally and that you have the appropriate permissions.

Thanks for the replies. I installed mini magick correctly and thumbnails are still not generated. I doesn't matter what image processor I use so I'm assuming that's not the problem.

Here is all my code incase someone can spot something:

create_table "photos" do |t|       t.column :user_id, :integer, :null => false       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

class Photo < ActiveRecord::Base   belongs_to :user

  has_attachment :content_type => :image,                  :storage => :s3,                  :max_size => 500.kilobytes,                  :resize_to => '150x150>',                  :thumbnails => { :thumb => [50, 50], :geometry => 'x50' },                  :processor => 'MiniMagick'

  validates_as_attachment end

def create     @user = User.new(params[:user])     @photo = Photo.new(params[:photo])     @user.photo = @photo

    if @user.save && @photo.save       flash[:notice] = 'User was successfully created.'       redirect_to user_url(@user)     else       render :action => "new"     end   end

Hi,

You need to have a 'parent_id' column in your photos table. This one had me scratching my head for a few hours too until I stumbled across this requirement of the plugin.

See the tutorial: http://clarkware.com/cgi/blosxom/2007/02/24

He doesn't mention that parent_id is required however.

Guy

jko170 wrote:

That fixed it. Thanks Guy!

One more quick question: Do you know how to make the thumbnail and images resize to an exact size? I guess that would require cropping?

hi just wondering if you solved this proble. i am having the same issue

mr_robot wrote:

hi just wondering if you solved this proble. i am having the same issue

'kay; same problem (thumbnails not being generated); happened just by moving from a model to another (from app/models/asset.rb to app/models/item.rb). columns are just fine; but still getting the same problem.

I just don't know what's the problem, is there any model caching or something like that in there ? weird…