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.
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.