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

Function createBlob

test/test.js:117–130  ·  view source on GitHub ↗

* Helper function to create a blob object from the given image data * * @param {ArrayBuffer} data Image data * @param {string} type Image content type * @returns {Blob} Image Blob object

(data, type)

Source from the content-addressed store, hash-verified

115 * @returns {Blob} Image Blob object
116 */
117 function createBlob(data, type) {
118 try {
119 return new Blob([data], { type: type })
120 } catch (e) {
121 var BlobBuilder =
122 window.BlobBuilder ||
123 window.WebKitBlobBuilder ||
124 window.MozBlobBuilder ||
125 window.MSBlobBuilder
126 var builder = new BlobBuilder()
127 builder.append(data)
128 return builder.getBlob(type)
129 }
130 }
131
132 /**
133 * Request helper function.

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected