Problem
I'm creating multiple charts that are then sent to the server to create a PDF. This data can get large.
Question
What is the best way to compress and send the image data to the server
Background
The charts I'm creating are fairly complex, to save myself the headache all of this is converted to a canvas where the base64 data uri is generated. Currently the data uri(s) are posted to the server to handle the processing. Posted info can get fairly large at around 400-600kb each for a small chart and 12mb for the largest chart.
The charts are org charts that can be manipulated/reordered.
Is there a better method of compressing these strings before sending it back up to the server?
Research
Some things I've check out:
https://github.com/brunobar79/J-I-C/blob/master/src/JIC.js (does not look like an option just resizes)
http://pastebin.com/MhJZBsqW (looks interesting)
But references external libraries that I cannot find: C_H_Image
Lib_MinifyJpeg
https://code.google.com/p/jslzjb/source/browse/trunk/Iuppiter.js?r=2 (looks like this could work but relies on decompression on server side)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…