Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crop and Upload image using jQuery/Java

I am looking for a jQuery plugin that allows the following:

  1. Select/Browse an image (from user's file system)
  2. Preview the image, with ability to CROP
  3. Upload the cropped image to server (JAVA Servlet)

Any pointers for this?

P.S. : I have found numerous standalone image cropping plugins (that work on pre-defined images), but not ones that allow uploading a custom image as well (over Java servlets).

like image 938
Saket Avatar asked Nov 13 '22 10:11

Saket


1 Answers

One way, to crop image before actually upload it to the server in HTML5 supported browsers, is explained here. Mentioned solution is combination of: JCrop, JQuery, HTML5's File and Canvas APIs.

The other way to go (for non HTML5 browsers) is:

  1. Select/browse image
  2. Upload it to server (as temporary image)
  3. Preview the image, with ability to CROP
  4. Send CROP coordinates to server
  5. Crop and save image on the server side
like image 96
PrimosK Avatar answered Nov 16 '22 02:11

PrimosK