SyntaxHighlighter

Tuesday, September 11, 2007

Image Upload and resizing using mini_magick

I got the image upload piece working on my new app. I used mini-magick and it went just great. I followed the post at railsforum and it went relatively smoothly. I had to unpack the gem for mini_magick and make it a plugin so it could run at TextDrive. They don't have this gem in their library.

1 comment:

  1. this is error stack when i m using mini_magick while uploading image...do u know why its happening?


    ImageMagick command (identify C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/minimagic4892-0 ) failed: Error Given 256


    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:98:in `run_command'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:55:in `initialize'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:37:in `new'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:37:in `from_blob'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:43:in `from_file'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:42:in `open'
    #{RAILS_ROOT}/vendor/plugins/mini_magick/lib/mini_magick.rb:42:in `from_file'
    #{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb:15:in `with_image'
    #{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:322:in `with_image'
    #{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb:30:in `process_attachment'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `send'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `callback'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `each'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `callback'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:301:in `valid?'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/validations.rb:751:in `save_without_transactions'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in `transaction'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:95:in `transaction'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:121:in `transaction'
    C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
    #{RAILS_ROOT}/app/controllers/test_upload_images_controller.rb:30:in `create'

    ReplyDelete