views:

331

answers:

2

Hello,

I using rails 2.3.4 and PaperClip gem as plugin (the latest git master). And, given the following code:

class Banner < ActiveRecord::Base
  has_attached_file :picture,
                :url => "/banners/:id/:basename.:extension",
                :path => ":rails_root/public/banners/:id/:basename.:extension",
                :style => { :original => '150x150>'}

If i upload a picture with size 359x359 it doesn't be resized to 150x150 but stored it's own size, what i don't want. Is there any way to enforce resizing or do something? I think i do something wrong but i don't know what...

A: 

You need to install a post-processor like ImageMagick.

Ryan Bigg
It seems solved, i copyied a code with typo: :style is not correct, :styles is works.
Gabor Garami
Btw, I read Paperclip can use RMagick. This is better than pure ImageMagick?
Gabor Garami
This article: http://robots.thoughtbot.com/post/159807225/for-attaching-files-use-paperclip says that you only need ImageMagick installed. RMagick uses ImageMagick so I can't imagine it being any better.
Ryan Bigg
RMagick is a Ruby wrapper around ImageMagick.
John Topley
+1  A: 

:style is incorrect. The symbol is :styles

ybakos
I written it in comments, but thanks the answer
Gabor Garami