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

Uppercase PNG extensions cause Error on upload #35

Closed ergec closed 8 years ago

ergec commented 8 years ago

I'm working on a modified code and i pass original filename to jic.upload() Problem is if PNG extension is uppercase the line 70 fails to set mimetype and tries to process a png image as a jpeg. As a result it fires the error below. Uncaught InvalidCharacterError: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. So i modified line 70 to lowercase extension.

brunobar79 commented 8 years ago

@ergec Good call! Can I ask you to add a version bump? Just make a global search and replace in the repo for 2.0.1 and change it for 2.0.2 so I can publish it to npm

Thanks!

ergec commented 8 years ago

@brunobar79 i updated the version in source file. Hope this is what you asked. Newbie here.

brunobar79 commented 8 years ago

@ergec Almost. The package.json needs to be updated too but that's fine. I'll take care. Thanks!