Answer the question
In order to leave comments, you need to log in
Library for crop/resize images?
I use the Flask framework for the website, in the admin panel there is the ability to upload images (they are loaded into GridFS / MongoDB), I would like to somehow fasten the functionality that will allow you to resize / crop images on the client side. Is it possible?
PS I make the site for myself, so the options can be any (resize on the server, including, for example, the front-end sends parameters and the server already using PIL / Pillow modifies images), because I would like to quickly launch into production.
Answer the question
In order to leave comments, you need to log in
Look at JCrop . Did something like this myself recently. The server part is in the php examples, but you can rewrite it for others without any problems. The whole principle of work in three steps:
1) On the client, in img, we load the picture. We throw .JCrop() on this picture;
2) Select the desired region for the crop;
3) When submitting, it sends the width, height and coordinates of the selected area. On the server, we simply make a copy from the source and cut it according to the given data when submitting.
Everything is simple and elegant.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question