MCPcopy Index your code
hub / github.com/blueimp/JavaScript-Load-Image / fetchBlobCallback

Function fetchBlobCallback

js/load-image.js:139–151  ·  view source on GitHub ↗

* Callback for the fetchBlob call. * * @param {Blob} blob Blob object * @param {Error} err Error object

(blob, err)

Source from the content-addressed store, hash-verified

137 * @param {Error} err Error object
138 */
139 function fetchBlobCallback(blob, err) {
140 if (err && $.console) console.log(err) // eslint-disable-line no-console
141 if (blob && isInstanceOf('Blob', blob)) {
142 file = blob // eslint-disable-line no-param-reassign
143 url = createObjectURL(file)
144 } else {
145 url = file
146 if (options && options.crossOrigin) {
147 img.crossOrigin = options.crossOrigin
148 }
149 }
150 img.src = url
151 }
152 img.onerror = function (event) {
153 revokeHelper(url, options)
154 if (reject) reject.call(img, event)

Callers 1

executorFunction · 0.85

Calls 2

isInstanceOfFunction · 0.85
createObjectURLFunction · 0.85

Tested by

no test coverage detected