Merge pull request #24 from andypiper/file-picker-update

main.js: only choose from image files
This commit is contained in:
NaitLee 2022-05-05 08:16:50 +08:00 committed by GitHub
commit da921d8e9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,6 +391,7 @@ class CanvasController {
}
let input = document.createElement('input');
input.type = 'file';
input.accept = 'image/*';
input.addEventListener('change', () => {
let url = URL.createObjectURL(input.files[0]);
put_image(url);