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~


Ruby on Rails Developer



www.joshsoftware.com

On Tue, Jul 28, 2009 at 4:37 PM, Sandip R.[email protected]
wrote:

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 T.
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.

On Wed, Jul 29, 2009 at 11:24 AM, Sandip R. [email protected]
wrote:

: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

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

On Wed, Jul 29, 2009 at 7:54 AM, Sandip R. [email protected]
wrote:

: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 T.
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings

Thanks, Andrew !
I will make that change

Sandip R~

On Wed, Jul 29, 2009 at 11:41 AM, Sandip R.[email protected]
wrote:

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 T.
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs