Class: PictureLazy
March 10, 2023 · View on GitHub
node-taglib-sharp / Exports / PictureLazy
Class: PictureLazy
This class implements IPicture and provides mechanisms for loading pictures from files. Contrary to Picture, a reference to a file where the picture is located can be given and the picture is lazily loaded from the file, meaning that it will be read from the file only when needed. This saves time and memory if the picture loading is not required.
Implements
Table of contents
Accessors
Methods
Accessors
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.
Returns
string
Implementation of
• set filename(value): void
Gets and sets a filename of the picture stored in the current instance. Optional.
Parameters
| Name | Type |
|---|---|
value | string |
Returns
void
Implementation of
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
Methods
load
▸ load(): void
Loads the object.
Returns
void
Implementation of
fromData
▸ Static fromData(data): PictureLazy
Constructs a new picture using data that's already been read into memory. The content will not be lazily loaded.
Parameters
| Name | Type | Description |
|---|---|---|
data | ByteVector | ByteVector Object containing picture data |
Returns
fromFile
▸ Static fromFile(file, offset, size?): PictureLazy
Constructs a new instance from a file abstraction. The content will be lazily loaded.
Parameters
| Name | Type | Description |
|---|---|---|
file | IFileAbstraction | File abstraction containing the file to read |
offset | number | Index into the file where the picture is located, must be a 32-bit integer |
size? | number | Optionally, size of the picture in bytes. If omitted, all bytes of file will be read when lazily loaded. Must be a 32-bit integer or undefined |
Returns
fromPath
▸ Static fromPath(filePath): PictureLazy
Constructs a new instance that will be lazily loaded from the filePath provided.
Parameters
| Name | Type | Description |
|---|---|---|
filePath | string | Path to the file to read |