karpathy / convnetjs

Deep Learning in Javascript. Train Convolutional Neural Networks (or ordinary ones) in your browser.
MIT License
10.9k stars 2.04k forks source link

fix for uploading image in mnist demo #96

Open KaeyangTheG opened 6 years ago

KaeyangTheG commented 6 years ago

I could not upload an image to test in the mnist demo. pica.js would throw an exception because preview image was empty. This was because the preview image was being created in js via new Image() and then assigned its src, but not being permitted to load before attempting to read its width and height.