views:

1982

answers:

3

I would like to crop images on upload using Paperclip to get square thumbs from the center of the original picture. I find out a method in documentation that seems to do exactly what I want:

transformation_to(dst, crop = false)

The problem is that I can't figure out where to use this method. It would be great to simply pass something as a parameter here:

  has_attached_file :picture, 
                    :styles => { :medium => "600x600>", :thumb => "something here" }
+4  A: 

You only need to use # instead of > as a parameter:

has_attached_file :picture, :styles => { :thumb => "200x200#" }
collimarco
A: 

Advanced tutorial using paperclip and a javascript library for cropping the images.

I have just found out this tutorial (and using it right now) and perhaps it would help you (or other StackOverflow viewers).

NicoJuicy
A: 

I wanna do the same thing but no with the center of the original picture, help!

Sergei Orozco
This sort of thing belongs in a comment, not an answer :)
Matchu