I
I
istinspring2013-09-22 01:29:54
JavaScript
istinspring, 2013-09-22 01:29:54

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

3 answer(s)
E
Eugene Obrezkov, 2013-09-22
@ghaiklor

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.

M
Mikhail Priver, 2013-09-22
@mpriver

Have a look at this github.com/blueimp/JavaScript-Load-Image

A
Anton, 2013-09-22
@sHinE

The file loader from mail.ru has the functions of resizing and cropping the image on the client side: github.com/mailru/FileAPI
True, for the interface, most likely, you will have to use something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question