Live image cropping with js + php
I would like to be able to resize images on my site. Algorithm:
- You upload an image to the site. (Gray)
- This image appears in the orange portion.
- The red part is rectangular, with which we can choose which part of the image to show in the preview_zone.
- After selecting the right zone, I click OK and the data (resize zone) is uploaded to the server.
- The server visits the image using PHP.
Perhaps you could find any articles on how to do this, or sites with such api. Or do it yourself. I would be very grateful for your help.
+3
source to share
1 answer
You should check out JCrop jQuery Image Crop Plugin:
http://deepliquid.com/content/Jcrop.html
Repo: https://github.com/tapmodo/Jcrop https://github.com/tapmodo/Jcrop/tree/master/demos
Examples: http://deepliquid.com/projects/Jcrop/demos.php
One of the demos seems to fit your requirements. (http://deepliquid.com/projects/Jcrop/demos.php?demo=live_crop). You can make small changes to get the desired result.
+8
source to share