Class: XiphPicture
March 10, 2023 · View on GitHub
node-taglib-sharp / Exports / XiphPicture
Class: XiphPicture
Interface that provides generic information about a picture, including its contents, as used by various formats.
Implements
Table of contents
Accessors
Methods
Accessors
colorDepth
• get colorDepth(): number
Gets the color depth of the picture in the current instance.
Returns
number
• set colorDepth(value): void
Sets the color depth of the picture in the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | Color depth of the picture. Must be a positive 32-bit integer |
Returns
void
data
• get data(): ByteVector
Gets and sets the picture data stored in the current instance.
Returns
Implementation of
• set data(value): void
Gets and sets the picture data stored in the current instance.
Parameters
| Name | Type |
|---|---|
value | ByteVector |
Returns
void
Implementation of
description
• get description(): string
Gets and sets a description of the picture stored in the current instance. Optional.
Returns
string
Implementation of
• set description(value): void
Gets and sets a description of the picture stored in the current instance. Optional.
Parameters
| Name | Type |
|---|---|
value | string |
Returns
void
Implementation of
filename
• get filename(): string
Gets and sets a filename of the picture stored in the current instance. Optional.
Remarks
This value is not stored in a XIPH picture and is only available if copied from another picture.
Returns
string
Implementation of
• set filename(value): void
Gets and sets a filename of the picture stored in the current instance. Optional.
Remarks
This value is not stored in a XIPH picture so setting it has no impact.
Parameters
| Name | Type |
|---|---|
value | string |
Returns
void
Implementation of
height
• get height(): number
Gets the height of the picture in the current instance in pixels.
Returns
number
• set height(value): void
Sets the height of the picture in the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | height of the picture in pixels, must be a positive 32-bit integer. |
Returns
void
indexedColors
• get indexedColors(): number
Gets the number of indexed colors in the picture represented by the current instance.
Returns
number
• set indexedColors(value): void
Sets the number of indexed colors in the picture represented by the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | Number of indexed colors in the pictures or 0 if the picture is not stored in an indexed format. Must be a positive 32-bit integer |
Returns
void
isLoaded
• get isLoaded(): boolean
Gets whether the object has been loaded.
Returns
boolean
Implementation of
mimeType
• get mimeType(): string
Gets and sets the mime-type of the picture data stored in the current instance.
Returns
string
Implementation of
• set mimeType(value): void
Gets and sets the mime-type of the picture data stored in the current instance.
Parameters
| Name | Type |
|---|---|
value | string |
Returns
void
Implementation of
type
• get type(): PictureType
Gets and sets the type of the content visible in the picture stored in the current instance.
Returns
Implementation of
• set type(value): void
Gets and sets the type of the content visible in the picture stored in the current instance.
Parameters
| Name | Type |
|---|---|
value | PictureType |
Returns
void
Implementation of
width
• get width(): number
Gets the width of the picture in the current instance in pixels.
Returns
number
• set width(value): void
Sets the width of the picture in the current instance.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | Width of the picture in pixels, must be positive 32-bit integer. |
Returns
void
Methods
load
▸ load(): void
Loads the object.
Returns
void
Implementation of
renderForFlacBlock
▸ renderForFlacBlock(): ByteVector
Renders the picture for use in a FLAC block.
Returns
renderForXiphComment
▸ renderForXiphComment(): string
Renders the picture for use in a XIPH comment block (ie, the same structure as a FLAC block, but base64 encoded).
Returns
string
fromFlacBlock
▸ Static fromFlacBlock(block, isLazy?): XiphPicture
Constructs and initializes a new instance by reading the contents of the picture from a FLAC block. Intended to be used by the FlacTag class.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
block | FlacBlock | undefined | FLAC block containing the Xiph image. |
isLazy | boolean | false | Whether or not to lazily load the data. For FLAC blocks, this will chain into the lazy loading capabilities of the block |
Returns
fromPicture
▸ Static fromPicture(picture): XiphPicture
Constructs and initializes a new instance by copying the properties of an IPicture object.
Parameters
| Name | Type | Description |
|---|---|---|
picture | IPicture | Object to copy properties from. |
Returns
fromXiphComment
▸ Static fromXiphComment(data, isLazy?): XiphPicture
Constructs and initializes a new instance by decoding and reading the contents of a raw Xiph image structure. Intended to be used by the XiphComment class.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
data | string | undefined | Object containing the raw, base64 encoded Xiph image |
isLazy | boolean | false | Whether or not to lazily load the data. For xiph comments, this only delays decoding the data from base64 |