Ask HN: Possible to re-compress JPEG on the client before upload?
Is it (already) possible to do that re-compression on the client side? So that I would only need to transmit some 100kB (800x600px) and not 3 MB or more. Something like:
(1) With javascript's new FileSystem API ( http://slides.html5rocks.com/#filewriter ) it would be possible to read the photo file's data into client side JS.
(2) Then it would be necessary to re-encode the JPEG data, which is possible, but I counld not find any library for that (yet). Anybody knows such a library?
(3) Last step would be to POST the re-compressed JPEG data to the server side for storage and get a URL to the stored photo file back from the server for inclusion into the client's HTML.
I am looking for some jQuery plugin, other JS library or example web page that does this. Suggestions
13 comments
[ 5.3 ms ] story [ 41.8 ms ] threadTBH this seems to me to be more of a StackOverflow question than Ask HN though.
More so if you don't care about IE < 10.
A quick google turned up the following:
http://www.bytestrom.eu/blog/2009/1120a_jpeg_encoder_for_jav...
https://gist.github.com/1245476
Hope it helps
>> The encoder expects a „CanvasPixelArray“ (as returned by the „getImageData“ method of a canvas).
I'd like to use raw binary data simply read from the local file system, and run it through an encoder.