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

Do not redraw image twice #24

Closed genesiscz closed 8 years ago

genesiscz commented 8 years ago

It isn't necessary to create second cavas for image to get dataURL out of it, because we've got it as dataURL before. Additionally, redrawing (with default 100% quality) made file even larger.

genesiscz commented 8 years ago

To me honest, this gave me hours of cancer because I couldn't manage WHY the compressed image has about 50% size of original image, but while uploading, it had more than 90% the original size. This had fixed it for me.

genesiscz commented 8 years ago

To be more certain, look at your example, which gives impressive result for compressed image, but not-so-impressive for an uploaded image. It kills whole purpose of compressing.

screenshot 2015-11-07 06 35 34
brunobar79 commented 8 years ago

Thank you for this!

liltinkerer commented 8 years ago

The bug still exists. At least on the demo.