Skip to content

Commit 7ff5f13

Browse files
jimmywartingLinusU
andauthored
Update lib/canvas.js
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
1 parent 03f2738 commit 7ff5f13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/canvas.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Canvas.prototype.createJPEGStream = function (options) {
5252
* @since NodeJS v18.0.0
5353
*/
5454
Canvas.prototype.convertToBlob = async function (options = {}) {
55+
// If the user agent does not support the requested type, then it must create the file using the PNG format.
56+
// ref: https://html.spec.whatwg.org/multipage/canvas.html#a-serialisation-of-the-bitmap-as-a-file
5557
const type = options.type && FORMATS.includes(options.type)
5658
? options.type
5759
: 'image/png'

0 commit comments

Comments
 (0)