paperclip image styles getting cropped

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~

uploading a square image is not a problem. but when i upload a rectangular image. image gets distorted.

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",

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

Thanks, Andrew ! I will make that change

Sandip R~