README
Classes
Functions
- createBlobFromBinaryArray(binaryArray, mimeType) ⇒
Blob
- createBlobFromDataUrl(dataUrl) ⇒
Blob
- readExifDataInDataUrl(dataUrl) ⇒
Object
|Object
- blobFromSrc(src, [options]) ⇒
Promise.<Blob>
- dataUrlFromSrc(src, [options]) ⇒
Promise.<string>
- dataUrlFromFile(file, [options]) ⇒
Promise.<string>
- blobFromFile(file, [options]) ⇒
Promise.<Blob>
BinaryFile
Kind: global class
Summary: A binary file abstraction that exposes methods for
reading data from a binary file.
- BinaryFile
- new BinaryFile(byteString)
- instance
- .toBlob(mimeType) ⇒
Blob
- .toBlob(mimeType) ⇒
- static
new BinaryFile(byteString)
Param |
---|
byteString |
Blob
binaryFile.toBlob(mimeType) ⇒ Kind: instance method of BinaryFile
Access: public
Param | Type | Description |
---|---|---|
mimeType | string |
A valid MIMEType |
BinaryFile
BinaryFile.parseDataUrl(dataUrl) ⇒ Kind: static method of BinaryFile
Access: public
Param |
---|
dataUrl |
Blob
createBlobFromBinaryArray(binaryArray, mimeType) ⇒ Kind: global function
Summary: Creates a Blob from a binary array, e.g. Uint16Array
Param | Type |
---|---|
binaryArray | TypedArray |
mimeType | string |
Blob
createBlobFromDataUrl(dataUrl) ⇒ Kind: global function
Summary: Creates a blob from a dataURL
Param | Type |
---|---|
dataUrl | string |
Object
| Object
readExifDataInDataUrl(dataUrl) ⇒ Kind: global function
Summary: Reads exif data out of a dataURL
Param | Type |
---|---|
dataUrl | string |
Promise.<Blob>
blobFromSrc(src, [options]) ⇒ Kind: global function
Summary: Convert an image at src url to blob
Param | Type | Description |
---|---|---|
src | string |
path to target image or dataURL |
[options] | Object |
|
[options.crossOrigin] | boolean |
Set to true to support cross origin sources. |
[options.mimeType] | string |
A valid MIME type. |
[options.maxAttempts] | number |
The maximum number of attempts to convert before timeout. |
[options.resolution] | number |
|
[options.resolution.x] | number |
Pixel dimension resolution on the x-axis. |
[options.resolution.y] | number |
Pixel dimension resolution on the y-axis. |
[options.orientation] | number |
Current orientation. A number 1-8 following EXIF Orientation rules. |
Promise.<string>
dataUrlFromSrc(src, [options]) ⇒ Kind: global function
Summary: Convert an image at src url to a dataURL
Param | Type | Description |
---|---|---|
src | string |
path to target image |
[options] | Object |
|
[options.crossOrigin] | boolean |
Set to true to support cross origin sources. |
[options.mimeType] | string |
A valid MIME type. |
[options.maxAttempts] | number |
The maximum number of attempts to convert before timeout. |
[options.resolution] | number |
|
[options.resolution.x] | number |
Pixel dimension resolution on the x-axis. |
[options.resolution.y] | number |
Pixel dimension resolution on the y-axis. |
[options.orientation] | number |
Current orientation. A number 1-8 following EXIF Orientation rules. |
Promise.<string>
dataUrlFromFile(file, [options]) ⇒ Kind: global function
Summary: Convert an image file to a dataURL
Param | Type | Description |
---|---|---|
file | File |
File to convert |
[options] | Object |
|
[options.crossOrigin] | boolean |
Set to true to support cross origin sources. |
[options.mimeType] | string |
A valid MIME type. |
[options.maxAttempts] | number |
The maximum number of attempts to convert before timeout. |
[options.resolution] | number |
|
[options.resolution.x] | number |
Pixel dimension resolution on the x-axis. |
[options.resolution.y] | number |
Pixel dimension resolution on the y-axis. |
[options.orientation] | number |
Current orientation. A number 1-8 following EXIF Orientation rules. |
Promise.<Blob>
blobFromFile(file, [options]) ⇒ Kind: global function
Summary: Convert an image file to a Blob
Param | Type | Description |
---|---|---|
file | File |
File to convert |
[options] | Object |
|
[options.crossOrigin] | boolean |
Set to true to support cross origin sources. |
[options.mimeType] | string |
A valid MIME type. |
[options.maxAttempts] | number |
The maximum number of attempts to convert before timeout. |
[options.resolution] | number |
|
[options.resolution.x] | number |
Pixel dimension resolution on the x-axis. |
[options.resolution.y] | number |
Pixel dimension resolution on the y-axis. |
[options.orientation] | number |
Current orientation. A number 1-8 following EXIF Orientation rules. |