==model (using attachment_fu)
class Picture < ActiveRecord::Base
belongs_to :user
has_attachment :content_type => :image,
:processor => ''image_science'',
:storage => :file_system,
:path_prefix => File.join(''public'',
''images'',
''pictures'', ''''),
:resize_to => ''400'',
:thumbnails => { :thumb => [150, 203]}
validates_as_attachment
end
will resize the image when created.
On Aug 27, 2:56 pm, Ravi Katta
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi,
>
> how to resize the images in rails app?
> i want 400X300 size images to display in my app.But if user enter
> 600X800 how to resize the image without effect on clarity?
>
> now i am using this code
>
> image >
Magick::Image.read("#{RAILS_ROOT}/public/gallery/#{review_img}").first
> selected_image = image.crop_resized(400,400)
>
selected_image.write("#{RAILS_ROOT}/public/gallery/#{review_img}")
>
> But it extract height and width.i dont want to extract only resize
> the image.
> any suggestion are appreciated.
>
> thanks,
> ravi.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---