diff --git a/README.md b/README.md index fea0de4..eb821f0 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,9 @@ Warning: this API uses [Promises](https://promisesaplus.com/), because it's not * [binaryStringToBlob(binary, type)](#binaryStringToBlob) * [blobToBase64String(blob)](#blobToBase64String) * [dataURLToBlob(dataURL)](#dataURLToBlob) -* [imgSrcToDataURL(src, type, crossOrigin)](#imgSrcToDataURL) -* [canvasToBlob(canvas, type)](#canvasToBlob) -* [imgSrcToBlob(src, type, crossOrigin)](#imgSrcToBlob) +* [imgSrcToDataURL(src, type, crossOrigin, quality)](#imgSrcToDataURL) +* [canvasToBlob(canvas, type, quality)](#canvasToBlob) +* [imgSrcToBlob(src, type, crossOrigin, quality)](#imgSrcToBlob) * [arrayBufferToBlob(buffer, type)](#arrayBufferToBlob) * [blobToArrayBuffer(blob)](#blobToArrayBuffer) @@ -288,7 +288,7 @@ blobUtil.dataURLToBlob(dataURL).then(function (blob) { ``` -###imgSrcToDataURL(src, type, crossOrigin) +###imgSrcToDataURL(src, type, crossOrigin, quality) Convert an image's src URL to a data URL by loading the image and painting it to a canvas. Returns a Promise. @@ -301,6 +301,8 @@ will only paint the first frame of an animated GIF. - type `string` | `undefined` - the content type (optional, defaults to 'image/png') - crossOrigin `string` | `undefined` - for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors +- quality `number` | `undefined` - a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp' **Returns**: `Promise` - Promise that resolves with the data URL string @@ -324,13 +326,15 @@ blobUtil.imgSrcToDataURL('http://some-other-site.com/img.jpg', 'image/jpeg', ``` -###canvasToBlob(canvas, type) +###canvasToBlob(canvas, type, quality) Convert a canvas to a Blob. Returns a Promise. **Params** - canvas `string` - type `string` | `undefined` - the content type (optional, defaults to 'image/png') +- quality `number` | `undefined` - a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp' **Returns**: `Promise` - Promise that resolves with the Blob @@ -357,7 +361,7 @@ blobUtil.canvasToBlob(canvas, 'image/webp').then(function (blob) { ``` -###imgSrcToBlob(src, type, crossOrigin) +###imgSrcToBlob(src, type, crossOrigin, quality) Convert an image's src URL to a Blob by loading the image and painting it to a canvas. Returns a Promise. @@ -370,6 +374,8 @@ will only paint the first frame of an animated GIF. - type `string` | `undefined` - the content type (optional, defaults to 'image/png') - crossOrigin `string` | `undefined` - for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors +- quality `number` | `undefined` - a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp' **Returns**: `Promise` - Promise that resolves with the Blob diff --git a/doc/fonts/OpenSans-Bold-webfont.eot b/doc/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 0000000..5d20d91 Binary files /dev/null and b/doc/fonts/OpenSans-Bold-webfont.eot differ diff --git a/doc/fonts/OpenSans-Bold-webfont.svg b/doc/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 0000000..3ed7be4 --- /dev/null +++ b/doc/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Bold-webfont.woff b/doc/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 0000000..1205787 Binary files /dev/null and b/doc/fonts/OpenSans-Bold-webfont.woff differ diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.eot b/doc/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 0000000..1f639a1 Binary files /dev/null and b/doc/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.svg b/doc/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 0000000..6a2607b --- /dev/null +++ b/doc/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.woff b/doc/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 0000000..ed760c0 Binary files /dev/null and b/doc/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Italic-webfont.eot b/doc/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 0000000..0c8a0ae Binary files /dev/null and b/doc/fonts/OpenSans-Italic-webfont.eot differ diff --git a/doc/fonts/OpenSans-Italic-webfont.svg b/doc/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 0000000..e1075dc --- /dev/null +++ b/doc/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Italic-webfont.woff b/doc/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 0000000..ff652e6 Binary files /dev/null and b/doc/fonts/OpenSans-Italic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Light-webfont.eot b/doc/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 0000000..1486840 Binary files /dev/null and b/doc/fonts/OpenSans-Light-webfont.eot differ diff --git a/doc/fonts/OpenSans-Light-webfont.svg b/doc/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 0000000..11a472c --- /dev/null +++ b/doc/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Light-webfont.woff b/doc/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 0000000..e786074 Binary files /dev/null and b/doc/fonts/OpenSans-Light-webfont.woff differ diff --git a/doc/fonts/OpenSans-LightItalic-webfont.eot b/doc/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 0000000..8f44592 Binary files /dev/null and b/doc/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/doc/fonts/OpenSans-LightItalic-webfont.svg b/doc/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 0000000..431d7e3 --- /dev/null +++ b/doc/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-LightItalic-webfont.woff b/doc/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 0000000..43e8b9e Binary files /dev/null and b/doc/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Regular-webfont.eot b/doc/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 0000000..6bbc3cf Binary files /dev/null and b/doc/fonts/OpenSans-Regular-webfont.eot differ diff --git a/doc/fonts/OpenSans-Regular-webfont.svg b/doc/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 0000000..25a3952 --- /dev/null +++ b/doc/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Regular-webfont.woff b/doc/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 0000000..e231183 Binary files /dev/null and b/doc/fonts/OpenSans-Regular-webfont.woff differ diff --git a/doc/index.js.html b/doc/index.js.html index 5243729..5aed6d9 100644 --- a/doc/index.js.html +++ b/doc/index.js.html @@ -28,10 +28,9 @@
'use strict';
 
-var utils = require('./utils');
 /* jshint -W079 */
 var Blob = require('blob');
-var Promise = utils.Promise;
+var Promise = require('pouchdb-promise');
 
 //
 // PRIVATE
@@ -233,15 +232,17 @@ function dataURLToBlob(dataURL) {
  * @param {string|undefined} type - the content type (optional, defaults to 'image/png')
  * @param {string|undefined} crossOrigin - for CORS-enabled images, set this to
  *                                         'Anonymous' to avoid "tainted canvas" errors
+ * @param {number|undefined} quality - a number between 0 and 1 indicating image quality
+ *                                     if the requested type is 'image/jpeg' or 'image/webp'
  * @returns {Promise} Promise that resolves with the data URL string
  */
-function imgSrcToDataURL(src, type, crossOrigin) {
+function imgSrcToDataURL(src, type, crossOrigin, quality) {
   type = type || 'image/png';
 
   return loadImage(src, crossOrigin).then(function (img) {
     return imgToCanvas(img);
   }).then(function (canvas) {
-    return canvas.toDataURL(type);
+    return canvas.toDataURL(type, quality);
   });
 }
 
@@ -249,16 +250,18 @@ function imgSrcToDataURL(src, type, crossOrigin) {
  * Convert a <code>canvas</code> to a <code>Blob</code>. Returns a Promise.
  * @param {string} canvas
  * @param {string|undefined} type - the content type (optional, defaults to 'image/png')
+ * @param {number|undefined} quality - a number between 0 and 1 indicating image quality
+ *                                     if the requested type is 'image/jpeg' or 'image/webp'
  * @returns {Promise} Promise that resolves with the <code>Blob</code>
  */
-function canvasToBlob(canvas, type) {
+function canvasToBlob(canvas, type, quality) {
   return Promise.resolve().then(function () {
     if (typeof canvas.toBlob === 'function') {
       return new Promise(function (resolve) {
-        canvas.toBlob(resolve, type);
+        canvas.toBlob(resolve, type, quality);
       });
     }
-    return dataURLToBlob(canvas.toDataURL(type));
+    return dataURLToBlob(canvas.toDataURL(type, quality));
   });
 }
 
@@ -273,15 +276,17 @@ function canvasToBlob(canvas, type) {
  * @param {string|undefined} type - the content type (optional, defaults to 'image/png')
  * @param {string|undefined} crossOrigin - for CORS-enabled images, set this to
  *                                         'Anonymous' to avoid "tainted canvas" errors
+ * @param {number|undefined} quality - a number between 0 and 1 indicating image quality
+ *                                     if the requested type is 'image/jpeg' or 'image/webp'
  * @returns {Promise} Promise that resolves with the <code>Blob</code>
  */
-function imgSrcToBlob(src, type, crossOrigin) {
+function imgSrcToBlob(src, type, crossOrigin, quality) {
   type = type || 'image/png';
 
   return loadImage(src, crossOrigin).then(function (img) {
     return imgToCanvas(img);
   }).then(function (canvas) {
-    return canvasToBlob(canvas, type);
+    return canvasToBlob(canvas, type, quality);
   });
 }
 
@@ -304,8 +309,14 @@ function arrayBufferToBlob(buffer, type) {
  * @returns {Promise} Promise that resolves with the <code>ArrayBuffer</code>
  */
 function blobToArrayBuffer(blob) {
-  return blobToBinaryString(blob).then(function (binary) {
-    return binaryStringToArrayBuffer(binary);
+  return new Promise(function (resolve, reject) {
+    var reader = new FileReader();
+    reader.onloadend = function (e) {
+      var result = e.target.result || new ArrayBuffer(0);
+      resolve(result);
+    };
+    reader.onerror = reject;
+    reader.readAsArrayBuffer(blob);
   });
 }
 
@@ -334,13 +345,13 @@ module.exports = {
 
 
 
 
-
+
- Documentation generated by JSDoc 3.3.0-alpha10 on Tue Nov 04 2014 15:42:40 GMT-0500 (EST) + Documentation generated by JSDoc 3.3.0-beta3 on Sat Jan 16 2016 14:43:19 GMT-0500 (EST)
diff --git a/doc/styles/jsdoc-default.css b/doc/styles/jsdoc-default.css index 7813ef8..24aa20f 100644 --- a/doc/styles/jsdoc-default.css +++ b/doc/styles/jsdoc-default.css @@ -1,57 +1,90 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + html { overflow: auto; background-color: #fff; + font-size: 14px; } body { - font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 130%; - color: #000; - background-color: #fff; + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; } -a { - color: #444; +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; } -a:visited { - color: #444; -} - -a:active { - color: #444; +a:hover { + text-decoration: underline; } header { display: block; - padding: 6px 4px; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .class-description { - font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 130%; line-height: 140%; margin-bottom: 1em; margin-top: 1em; } +.class-description:empty { + margin: 0; +} + #main { float: left; - width: 100%; + width: 70%; +} + +article dl { + margin-bottom: 40px; } section { display: block; - background-color: #fff; padding: 12px 24px; border-bottom: 1px solid #ccc; - margin-right: 240px; + margin-right: 30px; } .variation { @@ -68,26 +101,27 @@ section nav { display: block; - float: left; - margin-left: -230px; + float: right; margin-top: 28px; - width: 220px; + width: 30%; + box-sizing: border-box; border-left: 1px solid #ccc; - padding-left: 9px; + padding-left: 16px; } nav ul { font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; font-size: 100%; line-height: 17px; - padding:0; - margin:0; - list-style-type:none; + padding: 0; + margin: 0; + list-style-type: none; } -nav h2 a, nav h2 a:visited { - color: #A35A00; - text-decoration: none; +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; } nav h3 { @@ -98,18 +132,6 @@ nav li { margin-top: 6px; } -nav a { - color: #5C5954; -} - -nav a:visited { - color: #5C5954; -} - -nav a:active { - color: #5C5954; -} - footer { display: block; padding: 6px; @@ -118,39 +140,33 @@ footer { font-size: 90%; } +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + h1 { - font-size: 200%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 9px 0; + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; } -h2 +h2, h3 { - font-size: 170%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; -} - -h3 -{ - font-size: 150%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 6px 0 3px 0; + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; } h4 { - font-size: 130%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 18px 0 3px 0; - color: #A35A00; + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; } h5, .container-overview .subsection-title @@ -158,7 +174,7 @@ h5, .container-overview .subsection-title font-size: 120%; font-weight: bold; letter-spacing: -0.01em; - margin: 8px 0 3px -16px; + margin: 8px 0 3px 0; } h6 @@ -176,6 +192,11 @@ h6 text-decoration: none; } +.clear +{ + clear: both; +} + .important { font-weight: bold; @@ -191,11 +212,11 @@ h6 } .name, .signature { - font-family: Consolas, "Lucida Console", Monaco, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .details { margin-top: 14px; border-left: 2px solid #DDD; } -.details dt { width:120px; float:left; padding-left: 10px; padding-top: 6px; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } .details dd { margin-left: 70px; } .details ul { margin: 0; } .details ul { list-style-type: none; } @@ -205,14 +226,12 @@ h6 .description { margin-bottom: 1em; - margin-left: -16px; margin-top: 1em; } .code-caption { font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 107%; margin: 0; } @@ -230,14 +249,13 @@ h6 .prettyprint code { - font-family: Consolas, 'Lucida Console', Monaco, monospace; font-size: 100%; line-height: 18px; display: block; padding: 4px 12px; margin: 0; background-color: #fff; - color: #000; + color: #4D4E53; } .prettyprint code span.line @@ -286,8 +304,8 @@ h6 } .params .name, .props .name, .name code { - color: #A35A00; - font-family: Consolas, 'Lucida Console', Monaco, monospace; + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 100%; } @@ -316,13 +334,15 @@ h6 .params th, .props th { border-right: 1px solid #aaa; } .params thead .last, .props thead .last { border-right: 1px solid #ddd; } -.params td.description > p:first-child +.params td.description > p:first-child, +.props td.description > p:first-child { margin-top: 0; padding-top: 0; } -.params td.description > p:last-child +.params td.description > p:last-child, +.props td.description > p:last-child { margin-bottom: 0; padding-bottom: 0; diff --git a/doc/styles/prettify-tomorrow.css b/doc/styles/prettify-tomorrow.css index aa2908c..b6f92a7 100644 --- a/doc/styles/prettify-tomorrow.css +++ b/doc/styles/prettify-tomorrow.css @@ -98,7 +98,7 @@ /* pre.prettyprint { background: white; - font-family: Menlo, Monaco, Consolas, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; line-height: 1.5; border: 1px solid #ccc; diff --git a/index.html b/index.html index 7ae4b65..3b199ed 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,6 @@ - @@ -18,7 +17,9 @@
+

Global

+ @@ -36,11 +37,11 @@
- - + +

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.

Kirby

@@ -89,6 +90,8 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + + @@ -114,32 +117,31 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {

Methods

-
+ -
- -

arrayBufferToBlob(buffer, type) → {Promise}

- - - -
-
- - -
- Convert an ArrayBuffer to a Blob. Returns a Promise. -
- - +

arrayBufferToBlob(buffer, type) → {Promise}

+ + +
+ Convert an ArrayBuffer to a Blob. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -211,9 +213,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -238,12 +241,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -255,20 +260,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -287,37 +292,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

base64StringToBlob(base64, type) → {Promise}

- - - -
-
- - -
- Convert a base64-encoded string to a Blob. Returns a Promise. -
- - +

base64StringToBlob(base64, type) → {Promise}

+ + +
+ Convert a base64-encoded string to a Blob. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -389,9 +392,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -416,12 +420,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -433,20 +439,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -465,37 +471,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

binaryStringToBlob(binary, type) → {Promise}

- - - -
-
- - -
- Convert a binary string to a Blob. Returns a Promise. -
- - +

binaryStringToBlob(binary, type) → {Promise}

+ + +
+ Convert a binary string to a Blob. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -567,9 +571,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -594,12 +599,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -611,20 +618,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -643,37 +650,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

blobToArrayBuffer(blob) → {Promise}

- - - -
-
- - -
- Convert a Blob to an ArrayBuffer. Returns a Promise. -
- - +

blobToArrayBuffer(blob) → {Promise}

+ + +
+ Convert a Blob to an ArrayBuffer. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -719,9 +724,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -746,12 +752,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -763,20 +771,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the ArrayBuffer
@@ -795,37 +803,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

blobToBase64String(blob) → {Promise}

- - - -
-
- - -
- Convert a Blob to a binary string. Returns a Promise. -
- - +

blobToBase64String(blob) → {Promise}

+ + +
+ Convert a Blob to a binary string. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -871,9 +877,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -898,12 +905,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -915,20 +924,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the binary string
@@ -947,37 +956,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

blobToBinaryString(blob) → {Promise}

- - - -
-
- - -
- Convert a Blob to a binary string. Returns a Promise. -
- - +

blobToBinaryString(blob) → {Promise}

+ + +
+ Convert a Blob to a binary string. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -1023,9 +1030,10 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - + + +
@@ -1050,12 +1058,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -1067,20 +1077,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the binary string
@@ -1099,37 +1109,35 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

canvasToBlob(canvas, type) → {Promise}

- - - -
-
- - -
- Convert a canvas to a Blob. Returns a Promise. -
- - +

canvasToBlob(canvas, type, quality) → {Promise}

+ + +
+ Convert a canvas to a Blob. Returns a Promise. +
+ + + + + + + + + +
Parameters:
-
Parameters:
- @@ -1199,11 +1207,39 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { - -
- + + + + quality + + + + + +number +| + +undefined + + + + + + + + + + a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp' + + + + + + +
@@ -1228,12 +1264,14 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) { + +
Source:
@@ -1245,20 +1283,20 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -1277,40 +1315,38 @@ blobUtil.imgSrcToBlob(img.src).then(function (blob) {
- - - + + -
- -

createBlob(parts, options) → {Blob}

- - - -
-
-
- Shim for + +

createBlob(parts, options) → {Blob}

+ + + + + + - +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -1379,9 +1415,10 @@ to support
- - + + +
@@ -1406,12 +1443,14 @@ to support + +
Source:
@@ -1423,20 +1462,20 @@ to support
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
@@ -1451,40 +1490,38 @@ to support
- - - + + -
- -

createObjectURL(blob) → {string}

- - - -
-
-
- Shim for + +

createObjectURL(blob) → {string}

+ + + + + +
+ Shim for URL.createObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). -
- +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -1530,9 +1567,10 @@ to support browsers that only have the prefixed
- - + + +
@@ -1557,12 +1595,14 @@ to support browsers that only have the prefixed + +
Source:
@@ -1574,20 +1614,20 @@ to support browsers that only have the prefixed
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
url
@@ -1606,39 +1646,37 @@ to support browsers that only have the prefixed
- - - + + -
- -

dataURLToBlob(dataURL) → {Promise}

- - - -
-
-
- Convert a data URL string + +

dataURLToBlob(dataURL) → {Promise}

+ + + + + +
+ Convert a data URL string (e.g. 'data:image/png;base64,iVBORw0KG...') to a Blob. Returns a Promise. -
- +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -1684,9 +1722,10 @@ to a Blob. Returns a Promise.
- - + + +
@@ -1711,12 +1750,14 @@ to a Blob. Returns a Promise. + +
Source:
@@ -1728,20 +1769,20 @@ to a Blob. Returns a Promise.
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -1760,41 +1801,39 @@ to a Blob. Returns a Promise.
- - - + + -
- -

imgSrcToBlob(src, type, crossOrigin) → {Promise}

- - - -
-
-
- Convert an image's src URL to a Blob by loading the image and painting + +

imgSrcToBlob(src, type, crossOrigin, quality) → {Promise}

+ + + + + +
+ Convert an image's src URL to a Blob by loading the image and painting it to a canvas. Returns a Promise.

Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. -

- +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -1866,36 +1905,64 @@ will only paint the first frame of an animated GIF. - + - + + - - + + + + + + + + + + + + + + + + +
crossOrigin - - + + string | undefined - + for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors
quality + + +number +| + +undefined + + + + a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp'
- - + + +
@@ -1920,12 +1987,14 @@ will only paint the first frame of an animated GIF. + +
Source:
@@ -1937,20 +2006,20 @@ will only paint the first frame of an animated GIF.
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the Blob
@@ -1969,41 +2038,39 @@ will only paint the first frame of an animated GIF.
- - - + + -
- -

imgSrcToDataURL(src, type, crossOrigin) → {Promise}

- - - -
-
-
- Convert an image's src URL to a data URL by loading the image and painting + +

imgSrcToDataURL(src, type, crossOrigin, quality) → {Promise}

+ + + + + +
+ Convert an image's src URL to a data URL by loading the image and painting it to a canvas. Returns a Promise.

Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. -

- +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -2075,36 +2142,64 @@ will only paint the first frame of an animated GIF. - + - + + - - + + + + + + + + + + + + + + + + +
crossOrigin - - + + string | undefined - + for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors
quality + + +number +| + +undefined + + + + a number between 0 and 1 indicating image quality + if the requested type is 'image/jpeg' or 'image/webp'
- - + + +
@@ -2129,12 +2224,14 @@ will only paint the first frame of an animated GIF. + +
Source:
@@ -2146,20 +2243,20 @@ will only paint the first frame of an animated GIF.
- - - - - - -
Returns:
- - + + + + + + +
Returns:
+ +
Promise that resolves with the data URL string
@@ -2178,40 +2275,38 @@ will only paint the first frame of an animated GIF.
- - - + + -
- -

revokeObjectURL(url)

- - - -
-
-
- Shim for + +

revokeObjectURL(url)

+ + + + + +
+ Shim for URL.revokeObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). -
- +
- - - + + + + + +
Parameters:
-
Parameters:
- @@ -2257,9 +2352,10 @@ to support browsers that only have the prefixed
- - + + +
@@ -2284,12 +2380,14 @@ to support browsers that only have the prefixed + +
Source:
@@ -2301,22 +2399,21 @@ to support browsers that only have the prefixed
- - - - - - - -
- + + + + + + + + @@ -2332,16 +2429,16 @@ to support browsers that only have the prefixed
-
+
- Documentation generated by JSDoc 3.3.0-alpha10 on Sat Oct 25 2014 12:54:33 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-beta3 on Sat Jan 16 2016 14:43:19 GMT-0500 (EST)
- + \ No newline at end of file