MCPcopy Index your code
hub / github.com/methodofaction/Method-Draw / importImage

Function importImage

src/js/Image.js:5–11  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3 const reader = new FileReader();
4
5 function importImage(e){
6 const file = (e.type === "drop") ? e.dataTransfer.files[0] : this.files[0];
7 if (!file || file.type.indexOf("image") ) return alert("That doesn't seem to be an image");
8
9 if(file.type.indexOf("svg") != -1) importSvg(file)
10 else importImageFile(file);
11 }
12
13 function importImageFile(file) {
14

Callers 1

Image.jsFile · 0.70

Calls 2

importSvgFunction · 0.85
importImageFileFunction · 0.85

Tested by

no test coverage detected