Skip to content

Latest commit

 

History

History
290 lines (161 loc) · 5.89 KB

PictureLazy.md

File metadata and controls

290 lines (161 loc) · 5.89 KB

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

ByteVector

Implementation of

IPicture.data

set data(value): void

Gets and sets the picture data stored in the current instance.

Parameters

Name Type
value ByteVector

Returns

void

Implementation of

IPicture.data


description

get description(): string

Gets and sets a description of the picture stored in the current instance. Optional.

Returns

string

Implementation of

IPicture.description

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

IPicture.description


filename

get filename(): string

Gets and sets a filename of the picture stored in the current instance. Optional.

Returns

string

Implementation of

IPicture.filename

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

IPicture.filename


isLoaded

get isLoaded(): boolean

Gets whether the object has been loaded.

Returns

boolean

Implementation of

ILazy.isLoaded


mimeType

get mimeType(): string

Gets and sets the mime-type of the picture data stored in the current instance.

Returns

string

Implementation of

IPicture.mimeType

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

IPicture.mimeType


type

get type(): PictureType

Gets and sets the type of the content visible in the picture stored in the current instance.

Returns

PictureType

Implementation of

IPicture.type

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

IPicture.type

Methods

load

load(): void

Loads the object.

Returns

void

Implementation of

ILazy.load


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

PictureLazy


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

PictureLazy


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

Returns

PictureLazy