(file, width, height, resizeMethod, fixOrientation, callback)
| 921 | } |
| 922 | |
| 923 | createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) { |
| 924 | let fileReader = new FileReader(); |
| 925 | |
| 926 | fileReader.onload = () => { |
| 927 | file.dataURL = fileReader.result; |
| 928 | |
| 929 | // Don't bother creating a thumbnail for SVG images since they're vector |
| 930 | if (file.type === "image/svg+xml") { |
| 931 | if (callback != null) { |
| 932 | callback(fileReader.result); |
| 933 | } |
| 934 | return; |
| 935 | } |
| 936 | |
| 937 | this.createThumbnailFromUrl( |
| 938 | file, |
| 939 | width, |
| 940 | height, |
| 941 | resizeMethod, |
| 942 | fixOrientation, |
| 943 | callback |
| 944 | ); |
| 945 | }; |
| 946 | |
| 947 | fileReader.readAsDataURL(file); |
| 948 | } |
| 949 | |
| 950 | // `mockFile` needs to have these attributes: |
| 951 | // |
no test coverage detected