Ok so as many of know, safari mobile now allows file uploads through camera or image library.
The 'problem' is that when the picture is taken from the camera, it is sent as it is, meaning it is very heavy in memory (I think it's around 2 or 3 mb even on iphone 4).
This makes the upload really slow and also bandwidth consuming (not good for mobile). Do you know if, with the <file />
html tag, there is a way to say to iOS: "hey, can you also compress the picture a bit?" - like it's being done when said images are sent via the mail app.
Thanks in advance.
There's a library for that: https://github.com/gokercebeci/canvasResize
It works by putting the image to a
<canvas />
(smaller than original image), then getting the image data so you can post it to your server.I don't think you can actually do anything there. What you can do though is use the FILE API and slice the upload in smaller chunks, reducing the memory overload.
Here is an excellent post on how to do this:
http://www.html5rocks.com/en/tutorials/file/dndfiles/#toc-slicing-files