Hello All, I am using rails paperclip plugin for image upload. my image has different styles and the original image gets cropped while processing styled image. I dont want image to be cropped. Is there any way ???????? Thanks, Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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 -~----------~----~----~----~------~----~------~--~---
On Tue, Jul 28, 2009 at 4:37 PM, Sandip Ransing<san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > > I am using rails paperclip plugin for image upload. > my image has different styles and the original image gets cropped > while processing styled image. > > I dont want image to be cropped. > Is there any way ???????? > > > Thanks, > Sandip R~ >Paperclip should only adjust the original image if you have a style setup for :original Perhaps send your has_attached_file code if that doesn''t help Andrew Timberlake http://ramblingsonrails.com http://MyMvelope.com - The SIMPLE way to manage your savings
Hi here is my attached file code #Files attached to channels has_attached_file :logo, :styles => { :small_thumb => [ "64x44#", :jpg ], :large_thumb => [ "81x81#", :jpg ]}, :storage => :s3, :path => ":attachment/:id/:style.:extension", :s3_credentials => open( "#{RAILS_ROOT}/config/s3.yml", ''r'' ), :s3_permissions => ''public-read'', :bucket => ApplicationConfig[ ''s3_buckets'' ][ ''channels'' ][ ''logo'' ], :default_url => "/images/missing/channels/logo/:style.gif" Thanks, Sandip R~ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
uploading a square image is not a problem. but when i upload a rectangular image. image gets distorted. On Wed, Jul 29, 2009 at 11:24 AM, Sandip Ransing <san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi > > > here is my attached file code > > #Files attached to channels > has_attached_file :logo, > :styles => { :small_thumb => [ "64x44#", :jpg ], > :large_thumb => [ "81x81#", :jpg ]}, > :storage => :s3, > :path => ":attachment/:id/:style.:extension", > :s3_credentials => open( "#{RAILS_ROOT}/config/s3.yml", ''r'' ), > :s3_permissions => ''public-read'', > :bucket => ApplicationConfig[ ''s3_buckets'' ][ ''channels'' ][ ''logo'' ], > :default_url => "/images/missing/channels/logo/:style.gif" > > > Thanks, > Sandip R~ >-- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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 -~----------~----~----~----~------~----~------~--~---
On Wed, Jul 29, 2009 at 7:54 AM, Sandip Ransing <san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi > > > here is my attached file code > > #Files attached to channels > has_attached_file :logo, > :styles => { :small_thumb => [ "64x44#", :jpg ], > :large_thumb => [ "81x81#", :jpg ]}, > :storage => :s3, > :path => ":attachment/:id/:style.:extension", > :s3_credentials => open( "#{RAILS_ROOT}/config/s3.yml", ''r'' ), > :s3_permissions => ''public-read'', > :bucket => ApplicationConfig[ ''s3_buckets'' ][ ''channels'' ][ ''logo'' ], > :default_url => "/images/missing/channels/logo/:style.gif" > > > Thanks, > Sandip R~ >Sandip Based on this code, both the :small_thumb and :large_thumb will be cropped but nothing should be happening to the original image at all. First check you''re using the latest version of Paperclip and then file a bug with Paperclip if it persists. Andrew Timberlake http://ramblingsonrails.com http://MyMvelope.com - The SIMPLE way to manage your savings
solved "#" used in style needs to be removed. #Files attached to channels has_attached_file :logo, :styles => { :small_thumb => [ "64x44", :jpg ], :large_thumb => [ "81x81", :jpg ]}, :storage => :s3, :path => ":attachment/:id/:style.:extension", --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, Jul 29, 2009 at 11:41 AM, Sandip Ransing<san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> solved > > "#" used in style needs to be removed. > > #Files attached to channels > has_attached_file :logo, > :styles => { :small_thumb => [ "64x44", :jpg ], > :large_thumb => [ "81x81", :jpg ]}, > :storage => :s3, > :path => ":attachment/:id/:style.: > extension", >Sandip Your resizing will warp (squash or stretch) images if they don''t match your dimensions. To resize while maintaining aspect ratio, use "64x64>" - This will result in either the width or the height = 64 and the other side will be relatively smaller. To resize with crop, use "64x64#" - This will result in both width and height = 64 and the longer of the two will be cropped evenly on either side. You should usually use one of these unless you are very sure of the aspect ratio of the images being uploaded. Andrew Timberlake http://ramblingsonrails.com http://MyMvelope.com - The SIMPLE way to manage your savings