J I C is a Javascript Image Compressor using HTML5 Canvas & File API that allows you to compress your jpeg & png images before uploading to the server (100% client-side and no extra libraries required!)
In the example code you provided, you specify the value of 'quality' as having to be an integer from 0 to 100, when it really should be a floating point value from 0 to 1:
//An Integer from 0 to 100
var quality = 80;
...
//This function returns an Image Object
target_img.src = jic.compress(source_image,quality).src;
Took me a little while to figure out why the compression wasn't working correctly for me, until I took a look at the source code on your demo page :)
In the example code you provided, you specify the value of 'quality' as having to be an integer from 0 to 100, when it really should be a floating point value from 0 to 1:
//An Integer from 0 to 100 var quality = 80; ... //This function returns an Image Object target_img.src = jic.compress(source_image,quality).src;
Took me a little while to figure out why the compression wasn't working correctly for me, until I took a look at the source code on your demo page :)