MCPcopy Index your code
hub / github.com/dropzone/dropzone / displayExistingFile

Method displayExistingFile

src/dropzone.js:956–986  ·  view source on GitHub ↗
(
    mockFile,
    imageUrl,
    callback,
    crossOrigin,
    resizeThumbnail = true
  )

Source from the content-addressed store, hash-verified

954 // `callback` will be invoked when the image has been downloaded and displayed.
955 // `crossOrigin` will be added to the `img` tag when accessing the file.
956 displayExistingFile(
957 mockFile,
958 imageUrl,
959 callback,
960 crossOrigin,
961 resizeThumbnail = true
962 ) {
963 this.emit("addedfile", mockFile);
964 this.emit("complete", mockFile);
965
966 if (!resizeThumbnail) {
967 this.emit("thumbnail", mockFile, imageUrl);
968 if (callback) callback();
969 } else {
970 let onDone = (thumbnail) => {
971 this.emit("thumbnail", mockFile, thumbnail);
972 if (callback) callback();
973 };
974 mockFile.dataURL = imageUrl;
975
976 this.createThumbnailFromUrl(
977 mockFile,
978 this.options.thumbnailWidth,
979 this.options.thumbnailHeight,
980 this.options.thumbnailMethod,
981 this.options.fixOrientation,
982 onDone,
983 crossOrigin
984 );
985 }
986 }
987
988 createThumbnailFromUrl(
989 file,

Callers

nothing calls this directly

Calls 3

callbackFunction · 0.85
emitMethod · 0.80

Tested by

no test coverage detected