Skip to content

Commit

Permalink
Fix quality parameter for getDataURL()
Browse files Browse the repository at this point in the history
According to the documentation [1] the function `canvas.getDataURL()`
takes a quality level as second parameter. It is expected that this
parameter is a number in the range [0,1] rather than an object..

[1] https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
  • Loading branch information
tomka committed May 7, 2019
1 parent 8f888e2 commit 4db9b4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WebMWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*/
function renderAsWebP(canvas, quality) {
var
frame = canvas.toDataURL('image/webp', {quality: quality});
frame = canvas.toDataURL('image/webp', quality);

return decodeBase64WebPDataURL(frame);
}
Expand Down Expand Up @@ -618,7 +618,7 @@
}

var
webP = renderAsWebP(canvas, {quality: options.quality});
webP = renderAsWebP(canvas, options.quality);

if (!webP) {
throw "Couldn't decode WebP frame, does the browser support WebP?";
Expand Down

0 comments on commit 4db9b4c

Please sign in to comment.