Skip to main content

Class: ImageReader

Reads the content of an image file into a Document object (which stores the image file as a Blob).

Implements

Constructors

constructor

new ImageReader(): ImageReader

Returns

ImageReader

Methods

loadData

loadData(file, fs?): Promise<Document<Metadata>[]>

Public method for this reader. Required by BaseReader interface.

Parameters

NameTypeDefault valueDescription
filestringundefinedPath/name of the file to be loaded.
fsGenericFileSystemdefaultFSfs wrapper interface for getting the file content.

Returns

Promise<Document<Metadata>[]>

Promise<Document[]> A Promise object, eventually yielding zero or one ImageDocument of the specified file.

Implementation of

FileReader.loadData

Defined in

packages/core/src/readers/ImageReader.ts:18