jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 131 forks source link

Support Jcrop.setImage #61

Closed piotrekmonko closed 9 years ago

piotrekmonko commented 9 years ago

Hi jonasundderwolf.

Great piece of code you have there, bravo and many thanks for your work. Perhaps you'd be interested in my fork? Changelog:

Updated doc to reflect these.

Again, thank you for your work, you're great.

Cheers, Peter

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.3%) when pulling eae6367302ab34019c9778a9c51ade520869f70d on piotrekmonko:master into f10c390723217931daef58c7f1bd9873d37d7fb2 on jonasundderwolf:master.

anrie commented 9 years ago

Hey Peter,

using the FileReader API to make the cropping widget even more flexible definitely looks interesting, but I really could use an extended example to see the bigger picture.

If i get it correctly, boxWidth and boxHeight rescale the image to the given dimensions. Here we should check how to best sync the behaviour with the thumbnail creation which is currently done by the cropping widget. Essentially IMAGE_CROPPING_THUMB_SIZE already defines the desired box, so if we pass this through (instead), the new extra parameters probably shouldn't even be necessary.

I think it would help a lot if you could extend the example app with a working demo of using the FileReader API so things are somewhat easier to discuss.


Making it possible to optionally prevent the inclusion of IMAGE_CROPPING_JQUERY_URL is a great idea and should help with issues such as #45

Regarding the accessibility of the Jcrop API: Shouldn't it be sufficient to keep the jcrop var in the scope of our image cropping function and simply export it (next to our init function), so it is accessible to the outside as image_cropping.jcrop?

jonmer85 commented 9 years ago

Hey @piotrekmonko , I've been using your version of this library as I use the FileReader API to show an instant preview of the cropping image on the browser without posting to the server. Everything seems to be working good except that the cropping parameters are not correct when I reset the image with setImage. Do you have any code examples you could share of your usage?

Thanks, Jon

anrie commented 9 years ago

I am closing this, as the proposed changes are now merged.

It would be great to enhance the default cropping widget in one of the next releases, so that cropping via the FileReader API becomes the new standard and we just fall back to the traditional method on older browsers.

If you already have a working implementation, feel free to send a PR.