Skip to content

Clean up MetadataLoader.ts #277

Open
@bpatrik

Description

@bpatrik

Pigallery2 is using multiple exif, iptc parers (as I could not find one that can do all at once) to get all the metadata for a photo:

  1. fs.statSync for silesize, creation date (if i do not find any better from exif)

    const stat = fs.statSync(fullPath);

  2. ts-exif-parser for most of the exif data:

    const exif = ExifParserFactory.create(data).parse();

  3. image-size to get the photo dimension if 2) ts-exif-parser fails:

    const info = imageSize(fullPath);

    (The image dimension is a must for this app to work properly )

  4. ts-node-iptc for GPS/location, keywords, caption related info:

    const iptcData = IptcParser.parse(data);

  5. exifreader for faces and now for orientation as this lib parses that properly

    const exif = ExifReader.load(data);

This class needs a major refactor. Probably. exifreader would be able to handle all cases now. Reducing to only one lib, photo indexing would be probably way faster (instead of 4-5 file open, 1 would do the trick)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions