kirtithorat / carrierwave-crop

Carrierwave extension to crop uploaded images using Jcrop plugin with preview.
MIT License
94 stars 58 forks source link

some minor updates #6

Open musaffa opened 10 years ago

musaffa commented 10 years ago
kirtithorat commented 10 years ago

@musaffa Thanks for the input. Appreciate it.

Got a question for you. When you say "I use this gem to crop images even before being uploaded...", how exactly are you implementing it? How do you retrieve that image before uploading it for cropping. Also, are you considering versions of the image to be uploaded and cropped? My original intent of this gem is to crop the uploaded images which is why I have used before_update .

Regarding the naming suggestion, I am going to stick with the current field names prefixed with crop_ because they are related to the image (dimensions) and not related to the dimensions of cropbox .

As for the ActiveSupport::SafeBuffer suggestion goes, I would like to merge it with the current code but for that you would need to revert back the hidden field naming change to the original naming and submit again.

musaffa commented 10 years ago

ok i've removed cropbox suggestion.

To retrieve image before upload, you can use javascript's File Api. Just search 'javascript preview an image before it is uploaded' in google. There are tons of examples there. As soon as an image tag is created for a preview, an event handler should catch that change in dom and apply jcrop on it.

kirtithorat commented 9 years ago

@musaffa Thanks a lot! Could you please rebase and squash these commits after reverting the callback change. I think once that is done this should be good to go! Also, regarding the part of cropping images even before they are uploaded, may be you could think of opening it as a new pull request and we will treat it as a new feature or something.