kristianhentschel / boogle

An Javascript solver for a popular word game, using HTML 5 access to the device camera and client side image processing to read the problem.
https://kristianhentschel.github.io/boogle/
GNU General Public License v3.0
1 stars 0 forks source link

File input: ensure it is a valid file before using it. #5

Closed kristianhentschel closed 9 years ago

kristianhentschel commented 9 years ago

The file input onchange event also fires if the field is cleared or no file is selected. This means an invalid image is loaded and used for the next capture call.

Fix: check for empty string, and check mime type of the returned file before continuing with displaying and processing it.