Wednesday, August 23, 2017

Django - Image crop using a widget as a field in the form

I have a Product Model and Image Model with a Foreign key to the product model.


So in a form for Product creation I will have/need multiple Image File Upload inputs.


I want to replace the default Image file-upload form field with a Image (like a plus sign, like add a new image, using a widget).


When the user click on a add a new image a pop-up will apear with a javascript crop. I need to get the data(coordinates) from the javascript crop back to Django, use Pillow to crop and fill the Image Model field.


What is the best approach for this mechanism for the form field(will not be a real upload) ? , maybe a link to a tutorial


(I know there are some Django package that do something like that but are really what I want regarding crop control)





--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dca42a40-1bb2-4912-a91c-4e8225a34ed4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment