MCPcopy
hub / github.com/dropzone/dropzone / createThumbnail

Method createThumbnail

src/dropzone.js:923–948  ·  view source on GitHub ↗
(file, width, height, resizeMethod, fixOrientation, callback)

Source from the content-addressed store, hash-verified

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

Callers 3

resizeImageMethod · 0.95
test.jsFile · 0.80

Calls 2

callbackFunction · 0.85

Tested by

no test coverage detected