Sunday, May 22, 2011

[Rails] How do you crop an image with carrierwave 'after the fact' in rails?

What I'd like to do is upload an image, then take the user to a new
page where I will use Jcrop to let the user select the part of the
image they want to crop, and then store that image. Essentially, I
want to make it a 2-stage process.

I know how to do the javascript part, and I understand the basic flow
of how to create this functionality. However, I am not aware of the
carrierwave specifics on how to accomplish this.

The closest thing I can find is:

image.recreate_versions!

But I still can't pass in the height/width and starting x,y to crop
it.

For example, how can I tell carrierwave to do the cropping 'after the
fact' - i.e. not when the image is uploaded for the first time? I see
methods to "process" the image, but they happen automatically with
fixed Height and Width. How can I delay this?

Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate