Skip to content

Commit c2f11e0

Browse files
committed
Keep in 80 columns character limit.
1 parent 642bce8 commit c2f11e0

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# JavaScript Canvas to Blob
22

33
## Description
4-
Canvas to Blob is a polyfill for the standard JavaScript [canvas.toBlob](http://www.w3.org/TR/html5/scripting-1.html#dom-canvas-toblob) method.
4+
Canvas to Blob is a polyfill for the standard JavaScript
5+
[canvas.toBlob](http://www.w3.org/TR/html5/scripting-1.html#dom-canvas-toblob)
6+
method.
57

6-
It can be used to create [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects from an HTML [canvas](https://developer.mozilla.org/en-US/docs/HTML/Canvas) element.
8+
It can be used to create
9+
[Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
10+
objects from an HTML
11+
[canvas](https://developer.mozilla.org/en-US/docs/HTML/Canvas) element.
712

813
## Usage
914
Include the (minified) JavaScript Canvas to Blob script in your HTML markup:
@@ -12,10 +17,11 @@ Include the (minified) JavaScript Canvas to Blob script in your HTML markup:
1217
<script src="js/canvas-to-blob.min.js"></script>
1318
```
1419

15-
Then use the *canvas.toBlob()* method in the same way as the native implementation:
20+
Then use the *canvas.toBlob()* method in the same way as the native
21+
implementation:
1622

1723
```js
18-
var canvas = document.createElement('canvas');
24+
var canvas = document.createElement('canvas');
1925
/* ... your canvas manipulations ... */
2026
if (canvas.toBlob) {
2127
canvas.toBlob(
@@ -34,10 +40,14 @@ if (canvas.toBlob) {
3440
## Requirements
3541
The JavaScript Canvas to Blob function has zero dependencies.
3642

37-
However, Canvas to Blob is a very suitable complement to the [JavaScript Load Image](https://github.com/blueimp/JavaScript-Load-Image) function.
43+
However, Canvas to Blob is a very suitable complement to the
44+
[JavaScript Load Image](https://github.com/blueimp/JavaScript-Load-Image)
45+
function.
3846

3947
## API
40-
In addition to the **canvas.toBlob** polyfill, the JavaScript Canvas to Blob script provides one additional function called **dataURLtoBlob**, which is added to the global window object if no AMD loader is used to load the script:
48+
In addition to the **canvas.toBlob** polyfill, the JavaScript Canvas to Blob
49+
script provides one additional function called **dataURLtoBlob**, which is added
50+
to the global window object if no AMD loader is used to load the script:
4151

4252
```js
4353
// 80x60px GIF image (color black, base64 data):
@@ -49,7 +59,8 @@ var b64Data = 'R0lGODdhUAA8AIABAAAAAP///ywAAAAAUAA8AAACS4SPqcvtD6' +
4959
```
5060

5161
## Browsers
52-
The following browsers support either the native or the polyfill *canvas.toBlob()* method:
62+
The following browsers support either the native or the polyfill
63+
*canvas.toBlob()* method:
5364

5465
### Desktop browsers
5566

@@ -68,4 +79,5 @@ The following browsers support either the native or the polyfill *canvas.toBlob(
6879
[JavaScript Canvas to Blob Test](https://blueimp.github.io/JavaScript-Canvas-to-Blob/test/)
6980

7081
## License
71-
The JavaScript Canvas to Blob script is released under the [MIT license](http://www.opensource.org/licenses/MIT).
82+
The JavaScript Canvas to Blob script is released under the
83+
[MIT license](http://www.opensource.org/licenses/MIT).

js/canvas-to-blob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
// Convert base64 to raw binary data held in a string:
6262
byteString = atob(dataString);
6363
} else {
64-
// Convert base64/URLEncoded data component to raw binary data:
64+
// Convert base64/URLEncoded data component to raw binary:
6565
byteString = decodeURIComponent(dataString);
6666
}
6767
// Write the bytes of the string to an ArrayBuffer:

0 commit comments

Comments
 (0)