node-taglib-sharp / Exports / 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.
• get
data(): ByteVector
Gets and sets the picture data stored in the current instance.
• set
data(value
): void
Gets and sets the picture data stored in the current instance.
Name | Type |
---|---|
value |
ByteVector |
void
• get
description(): string
Gets and sets a description of the picture stored in the current instance. Optional.
string
• set
description(value
): void
Gets and sets a description of the picture stored in the current instance. Optional.
Name | Type |
---|---|
value |
string |
void
• get
filename(): string
Gets and sets a filename of the picture stored in the current instance. Optional.
string
• set
filename(value
): void
Gets and sets a filename of the picture stored in the current instance. Optional.
Name | Type |
---|---|
value |
string |
void
• get
isLoaded(): boolean
Gets whether the object has been loaded.
boolean
• get
mimeType(): string
Gets and sets the mime-type of the picture data stored in the current instance.
string
• set
mimeType(value
): void
Gets and sets the mime-type of the picture data stored in the current instance.
Name | Type |
---|---|
value |
string |
void
• get
type(): PictureType
Gets and sets the type of the content visible in the picture stored in the current instance.
• set
type(value
): void
Gets and sets the type of the content visible in the picture stored in the current instance.
Name | Type |
---|---|
value |
PictureType |
void
▸ load(): void
Loads the object.
void
▸ Static
fromData(data
): PictureLazy
Constructs a new picture using data that's already been read into memory. The content will not be lazily loaded.
Name | Type | Description |
---|---|---|
data |
ByteVector |
ByteVector Object containing picture data |
▸ Static
fromFile(file
, offset
, size?
): PictureLazy
Constructs a new instance from a file abstraction. The content will be lazily loaded.
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 |
▸ Static
fromPath(filePath
): PictureLazy
Constructs a new instance that will be lazily loaded from the filePath provided.
Name | Type | Description |
---|---|---|
filePath |
string |
Path to the file to read |