Bug 51652 - Add canvas.toBlob
Summary: Add canvas.toBlob
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2010-12-27 13:22 PST by Charles Pritchard
Modified: 2017-02-16 20:47 PST (History)
10 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Charles Pritchard 2010-12-27 13:22:46 PST
Using the same semantics as toDataURL (image/png is the default output), add Blob getBlob([Optional] in DOMString contentType, [Optional] args...).

Currently, an image must be copied to a string using toDataURL, then to an array buffer using base64 decoding, before it can be run through createObjectURL. getBlob would reduce the number of operations.
Comment 2 Charles Pritchard 2011-09-04 10:10:05 PDT
Support for Canvas toBlob is likely to come from Chromium:
Comment 3 Ryosuke Niwa 2017-02-16 20:47:47 PST
This API has been renamed to toBlob: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob