brunobar79 / J-I-C

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!)
http://makeitsolutions.com/labs/jic/
MIT License
857 stars 196 forks source link

Incorrect 'quality' value in example provided #5

Closed guag closed 10 years ago

guag commented 10 years ago

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 :)

brunobar79 commented 10 years ago

Nice catch! I'm gonna fix this ASAP.

guag commented 10 years ago

Awesome, and great work by the way.

brunobar79 commented 10 years ago

Thanks! I changed the code to match the docs!