Playground for blob-util
- - -Welcome to the docs and playground for blob-util!
Below you'll find API documentation, as well as a little Kirby GIF you can play around with.
-
Here's some code to get you started. Copy-paste this into your console:
-+Welcome to the docs and playground for
+blob-util!Below you'll find API documentation, as well as a little Kirby GIF you can play around with.
++
Here's some code to get you started. Copy-paste this into your console:
+-var img = document.getElementById('kirby'); @@ -59,7 +37,26 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { img.parentNode.appendChild(newImg); });If you see two Kirbys, you're on your way!
+If you see two Kirbys, you're on your way!
+ + + + ++ + + + + + + + ++ + + + +@@ -108,7 +105,9 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { - + + + @@ -122,7 +121,9 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { +
arrayBufferToBlob(buffer, type) → {Promise}
+ @@ -248,7 +249,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -296,12 +297,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
base64StringToBlob(base64, type) → {Promise}
+ @@ -427,7 +432,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -475,12 +480,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
binaryStringToBlob(binary, type) → {Promise}
+ @@ -606,7 +615,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -654,12 +663,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
blobToArrayBuffer(blob) → {Promise}
+ @@ -759,7 +772,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -807,12 +820,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
blobToBase64String(blob) → {Promise}
+ @@ -912,7 +929,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -960,12 +977,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
blobToBinaryString(blob) → {Promise}
+ @@ -1065,7 +1086,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -1113,12 +1134,175 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + + +
blobToDataURL(blob) → {Promise}
+ + + + + + ++ Convert a+ + + + + + + + + +Blobto a data URL string +(e.g.'data:image/png;base64,iVBORw0KG...'). +Returns a Promise. +Parameters:
+ + ++ +
+ + + + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + ++ + + blob+ + +Blob + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +- Source:
+- + + + + + + + +
Returns:
+ + ++ Promise that resolves with the data URL string ++ + + ++
+ + + + + + + + + + + + +- + Type +
+- + +Promise + + +
+canvasToBlob(canvas, type, quality) → {Promise}
+ @@ -1271,7 +1455,7 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {- Source:
- @@ -1319,12 +1503,16 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + +
createBlob(parts, options) → {Blob}
+ @@ -1450,7 +1638,7 @@ to support- Source:
- @@ -1494,12 +1682,16 @@ to support + + +
createObjectURL(blob) → {string}
+ @@ -1602,7 +1794,7 @@ to support browsers that only have the prefixed- Source:
- @@ -1650,12 +1842,16 @@ to support browsers that only have the prefixed + + +
dataURLToBlob(dataURL) → {Promise}
+ @@ -1757,7 +1953,7 @@ to aBlob. Returns a Promise.- Source:
- @@ -1805,12 +2001,16 @@ to a
Blob. Returns a Promise. + + +imgSrcToBlob(src, type, crossOrigin, quality) → {Promise}
+ @@ -1994,7 +2194,7 @@ will only paint the first frame of an animated GIF.- Source:
- @@ -2042,12 +2242,16 @@ will only paint the first frame of an animated GIF. + + +
imgSrcToDataURL(src, type, crossOrigin, quality) → {Promise}
+ @@ -2231,7 +2435,7 @@ will only paint the first frame of an animated GIF.- Source:
- @@ -2279,12 +2483,16 @@ will only paint the first frame of an animated GIF. + + +
revokeObjectURL(url)
+ @@ -2387,7 +2595,7 @@ to support browsers that only have the prefixed- Source:
- @@ -2413,6 +2621,8 @@ to support browsers that only have the prefixed + + @@ -2429,17 +2639,17 @@ to support browsers that only have the prefixed
- + -
