Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:29:17+00:00 2026-06-08T05:29:17+00:00

In my user model I want to resize the image on upload. I am

  • 0

In my user model I want to resize the image on upload. I am storing the images on amazon s3. Everything worked great and the image displays, uploads, deletes, etc. until I tried to add the after_assign method in the image_accessor block.

Here is the error:

None of the functions registered with Dragonfly::Processor were able to deal with the 
method call thumb

I’ve followed the tutorials online, and double-checked everything. I figure it is an error with imagemagick or rmagick, but after reinstalling both Im at a loss. My path for $ which convert is /opt/local/bin/convert which I am pretty sure is good that the path shows up.

Any suggestions on how to get process to work? I am running on Snow Leopard, Ruby 1.9.3 and Rails 3.2.5


For reference:

Here is my user model:

class User < ActiveRecord::Base

    image_accessor :avatar do
      storage_path{ |file| "#{self.id}/avatar/#{rand(1000)}.#{file.format}" }
      after_assign{ |a| a.thumb!('300x300#') }
    end

  ...

  attr_accessible :name, :location, :avatar, :retained_avatar,
    # Used by Devise
    :email, :password, :password_confirmation, :remember_me, :confirmed_at

  validates_size_of      :avatar, maximum: 5.megabytes, allow_nil: true
  validates_property :format, of: :avatar, 
    in: [ :jpg, :png, :gif ], case_sensitive: false, allow_nil: true, 
    message: "Only .jpg, .png and .gif file formats are supported."

end

Here is my dragonfly initializer

require 'dragonfly'

app = Dragonfly[:images]

app.configure_with(:imagemagick)
app.configure_with(:rails)

app.datastore = Dragonfly::DataStorage::S3DataStore.new

app.datastore.configure do |c|
  c.bucket_name = ENV['S3_BUCKET']
  c.access_key_id = ENV['S3_KEY']
  c.secret_access_key = ENV['S3_SECRET']
  c.url_scheme = 'https' 
end

app.define_macro(ActiveRecord::Base, :image_accessor)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:29:20+00:00Added an answer on June 8, 2026 at 5:29 am

    if your file is called :photo, then its after_assign should be after_assign { |a| self.photo = a.thumb('300x300#) }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a devise user model with pro boolean column.I want to build a
I have a typical User model (username, password, name, etc). I want to allow
I want to send ViewData.model to Special action with the last user data entry.
I have a model called Person. I want User to inherit from Person. class
model.py: class Tribes(Group): members = models.ManyToManyField(User, related_name='tribes', verbose_name=_('members')) i want to store a number
I want to be able to resize the default profile image I use with
I want to add a new function to the default User model of Django
I have a user model and a bid model. I want the user to
I have a model in rails, lets say User , which i want to
I want to monkey patch the user model from Django. My code: from django.db

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.