I am currently trying to create an application on RoR and I am using
attachmne_fu plugin in order to handle image uploads.
I have also install ImageScience to create some thumbnails for the
images I upload
The problem is that I can upload images, but it resizes the original
image to the thumbnail version. I don''t know why.
For example if I upload an image say IMG_2455.jpg, in the directory
0000/0002 I have 2 files:
a) IMG_2455.jpg
b) IMG_2455_thumb.jpg
but the original image is also resized! so i have two images of 125x83
dimensions.
How can I keep the original image plus the thumbnail version ?
Here is my code in my model
class Photo < ActiveRecord::Base
belongs_to :user
has_attachment :content_type => :image,
:storage => :file_system,
:size => 1.byte..12.megabytes,
:thumbnails => { :thumb =>
''125x83>'' },
:path_prefix => "/public/photos/"
validates_as_attachment
end
Any suggestions ??
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Just out of curiousity, add a
:resize_to => ''5000x5000>'',
before the thumbnails option. It *should* leave any image smaller than
5000x5000 alone. Obviously, this is an awfully ugly hack, but humor me,
and see if the presence of the resize_to option makes a difference.
I use ImageMagick and a
has_attachment :content_type => [''image/jpeg'',
''image/png''],
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => ''1600x1200>'',
:thumbnails => { :thumb =>
''100x100>''}
to resize any larger image to something that fits full screen on my
monitor, and the file system has the original, and a thumbnail, both
properly sized, even when the original is a 1024x768 image. Larger
images get sized down to 1600x1200.
--
Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
It may have nothing to do with your situation, but I once had a similar experince when I forgot to install image magick... but I think Ar''s advice will probably work Cheers Richard, On Mar 19, 7:00 am, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Just out of curiousity, add a > > :resize_to => ''5000x5000>'', > > before the thumbnails option. It *should* leave any image smaller than > 5000x5000 alone. Obviously, this is an awfully ugly hack, but humor me, > and see if the presence of the resize_to option makes a difference. > > I use ImageMagick and a > > has_attachment :content_type => [''image/jpeg'', ''image/png''], > :storage => :file_system, > :max_size => 500.kilobytes, > :resize_to => ''1600x1200>'', > :thumbnails => { :thumb => ''100x100>''} > > to resize any larger image to something that fits full screen on my > monitor, and the file system has the original, and a thumbnail, both > properly sized, even when the original is a 1024x768 image. Larger > images get sized down to 1600x1200. > -- > 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 -~----------~----~----~----~------~----~------~--~---