Skip to content

blob

Contains utility functions for Blob objects.

InterfaceDescription
BlobToJpegArrayBufferOptionsOptions for blobToJpegArrayBuffer.
FunctionDescription
blobToArrayBufferConverts a Blob object to an ArrayBuffer.
blobToDataUrlConverts a Blob object to a data URL.
blobToJpegArrayBufferConverts a Blob object to a JPEG ArrayBuffer with the specified quality. The conversion is a canvas re-encode, which keeps only the pixels — EXIF, GPS, XMP and the ICC profile are dropped by construction. Pass BlobToJpegArrayBufferOptions.shouldPreserveMetadata to carry those segments across from the source, which works only when the source is itself a JPEG: nothing else stores them in a form that can be copied verbatim.
dataUrlToArrayBufferConverts a base64 encoded string to an ArrayBuffer.
isImageFileChecks if a given file is an image.