How to crop image in PHP by setting the size using Javscript for miniatures?

Well, for example in VKONTAKTE downloaded the image, chose the size using JS and a beautiful crop
July 9th 19 at 11:07
2 answers
July 9th 19 at 11:09
2(4 digits) tops and cut,Google the client part and the server
can you elaborate? - Kelley commented on July 9th 19 at 11:12
the 2 rectangle tops,which are defined by two pairs of numbers.
They are sufficient to circumcision pictures. If I correctly understood the task. - mercedes commented on July 9th 19 at 11:15
July 9th 19 at 11:11
There are 2 ways:
1. On the server (GD2, imagick): from customer are only the coordinates of the vertices of the main diagonal of the rectangular region. The transfer of coordinates - to validate CROP-a.
2. On the client (canvas): using the canvas all trimmed and sent. Send the image via AJAX/POST.
3. Code - write yourself.

Find more questions by tags JavaScriptPHP