Skip to content

Documentation / @ripl/core / dataURLToBlob

Function: dataURLToBlob() ​

dataURLToBlob(dataURL): Blob

Defined in: packages/core/src/context/export.ts:12

Converts a base64 data URL into a Blob synchronously.

Canvas-backed contexts already hold a data URL by the time they build a ContextExport, and the async canvas.toBlob would make every exporter a promise for no gain — this decodes the base64 payload in place instead. A URL carrying no recognisable MIME type is treated as image/png, which is what every caller here produces.

Parameters ​

ParameterTypeDescription
dataURLstringThe data: URL to decode.

Returns ​

Blob

A blob holding the URL's decoded bytes.