Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
131
rated 0 times [  137] [ 6]  / answers: 1 / hits: 33501  / 13 Years ago, wed, july 27, 2011, 12:00:00

I'd like to use javascript or jQuery to crop and compress an image on the client side before uploading to the server.



WorkFlow:




  1. Select Image

  2. Crop Image to specific size

  3. Compress the crop

  4. Upload



Has anyone done this before? What plugin or what do I have to do?



I see facebook can do compressing images and automatically resizing them before uploading.


More From » jquery

 Answers
9

EDIT (2014): This answer is now obsolete! JavaScript is a programming language with implementations that are deeply influenced
by what browser resources are being made available to them. Three
years ago when this post was made (July 2011) browsers didn't have any
kind of reliable functionality which would allow OP to do what he
asked for, hence my answer.


If you are still interested in how this can be done now please consult some of the many answers to this question which have appeared
in the meantime on SO. But please restrain yourself from making any
further comments to this answer because its obviously pointless. Thank you.




Simply put JavaScript is not meant to do what you are asking for. Whatever service you encounter that offers the ability to manipulate selected images you can bet your money that the image has been uploaded completely to the server before any other functionality was offered.


[#90966] Tuesday, July 26, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aricl

Total Points: 215
Total Questions: 91
Total Answers: 94

Location: Venezuela
Member since Thu, Jul 15, 2021
3 Years ago
aricl questions
Mon, Aug 2, 21, 00:00, 3 Years ago
Mon, Aug 3, 20, 00:00, 4 Years ago
Thu, Feb 13, 20, 00:00, 4 Years ago
Wed, Oct 23, 19, 00:00, 5 Years ago
;