new Blob()
The value of a blob attribute.
Methods
base64String() → {string}
Returns the blob bytes as base 64 encoded string
- Type:
- string
charset() → {string}
Returns the charset of the blob
- Since
- 5.1.0
- Type:
- string
convertImage(mediaType) → {$k.NetEntity}
Converts the image to another media type
Name | Type | Description |
---|---|---|
mediaType | string | The media type of the converted image |
If the image could not be converted
The converted image
- Type:
- $k.NetEntity
createThumbnail(width, height, mediaTypeopt) → {$k.NetEntity}
Create a thumbnail with the specified maxium dimensions. The aspect ratio is preserved. Width or height can be undefined, but not both. The media type is optional and specifies the image type of the thumbnail. If not defined, the thumbnail will have the same type as the original image.
Name | Type | Attributes | Description |
---|---|---|---|
width | number | The maximum width of the thumbnail | |
height | number | The maximum height of the thumbnail | |
mediaType | string | <optional> | The media type of the converted image |
If the image could not be converted
The converted image
- Type:
- $k.NetEntity
dataUrl() → {string}
Returns the blob bytes as a data URL
- Type:
- string
equals(value) → {boolean}
Returns true if the values are equal
Name | Type | Description |
---|---|---|
value | Another attribute value |
- Type:
- boolean
fileExtension() → {string}
Returns the extension of the filename of the blob, without dot
- Type:
- string
fileId() → {number}
Returns the file identifiert of the blob, which will change when the file contents change
- Since
- 5.4.2
- Type:
- number
filename() → {string}
Returns the filename of the blob
- Type:
- string
imageDimensions() → {array}
Returns the image dimensions in pixels as array.
If the blob is no image.
Array containing width as first and height as second element.
- Type:
- array
language() → {string}
Returns the language of the blob, or undefined if not translated
- Type:
- string
locator() → {string}
Returns a string that identifies the blob. Can be used to get the blob contents from the blob REST service. Returns undefined if the blob is not stored as the value of an attribute yet.
- Type:
- string
mimeType() → {string}
Returns the mime type of the blob
- Type:
- string
setBase64String(string) → {blob}
Set the blob bytes from base 64 encoded string
Name | Type | Description |
---|---|---|
string | string | A base 64 encoded string |
- Since
- 4.1.0
- Type:
- blob
setCharset(string) → {blob}
Set the charset of the blob
Name | Type | Description |
---|---|---|
string | string |
- Since
- 5.1.0
- Type:
- blob
setFilename(string) → {blob}
Set the filename of the blob
Name | Type | Description |
---|---|---|
string | string |
- Since
- 4.1.0
- Type:
- blob
setMimeType(string) → {blob}
Set the mime type of the blob
Name | Type | Description |
---|---|---|
string | string |
- Since
- 4.1.0
- Type:
- blob
size() → {number}
Returns the byte size of the blob
- Type:
- number
text(charsetopt) → {string}
Returns the blob bytes as string
Name | Type | Attributes | Description |
---|---|---|---|
charset | string | <optional> | Charset of the characters. UTF-8 if undefined |
- Type:
- string
toNetEntity() → {$k.NetEntity}
Creates a NetEntity from this blob
- Type:
- $k.NetEntity