I have a form with some fields, including a input type='file', used to upload images.
I'm searching for a way to resize de image selected by this field, but not upload immediatly.
I've read some tutorials that teaches the following proccess:
1 - catch the image using 'onchange' event on the file field;
2 - create a canvas element with the desired image size;
3 - draw the image in the canvas element and read its contents;
4 - send the image data asynchronously (ajax) using FormData.
I'd like to do the same thing until step 3, and then send the resized image together with the other fields when the user clicks the form's submit button.
Does anybody have any idea?
Thanks!
Ps: Some posts that ALMOST do what I desire:
http://coding.pressbin.com/84/File-API-Resize-photo-before-upload/
Resizing an image in an HTML5 canvas