Extractor plugin
A extractor creates meta information from the original file or form other extractor files.
As example: The Exif extractor reads the image and provides exif data as meta data to the storage. The geo reverse plugin reads the exif meta data, requests the address from a remote service and stores these address as further meta information.
Further example: The image resizer reads the image and stores the preview file in the storage. The AI extractor reads a small preview image, sends it to the api service and stores similarity vectors as new meta data.
The extractor has following phases
- meta
- raw
- file
The meta phase reads basic meta data from files for each file.
The raw phase receives a file grouped by sidecars and can extract images from raw files. The assumption is that a raw file extraction is expensive and should only be executed if no image sidecar is available.
The file phase is called again for each file (sidecar files are flatten again).
Therefore the extracor object has a name and
phase property and a create function. The
async create() function returns:
- a extractor function
(entry) => Promise<void>or - a task object with optional
test?: (entry) => boolean, a requiredtask: (entry) => Promise<void>and optionalend: () => Promise<void>function or - a stream
Transformobject
The storage object has functions to read data from and write data to the object storage.