Re-Crop Image using Jcrop and Paperclip

For the people who wanted to crop an image twice or wanted to give users an option to re-crop the image without uploading it again. So here it is by the below mentioned code , only the small image will be cropped and you can use large to show the user an option to re-corp without hurting the cropping ratio.


So In your model you need to mention :
:styles => { :small => "150x150#", :large => "400x400>" },
:processors => [:cropper]

And the change which you need to make is :

:styles => {
  :small => {:geometry => "150x150#", :processors => [:cropper]},
  :large => {:geometry => "400x400>"}
}



Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Interview Question on Ruby on Rails