question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clean up MetadataLoader.ts

See original GitHub issue

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) https://github.com/bpatrik/pigallery2/blob/36ecbcbd3d5d3e659ddf20add456982dcb960d3d/src/backend/model/threading/MetadataLoader.ts#L107

  2. ts-exif-parser for most of the exif data: https://github.com/bpatrik/pigallery2/blob/36ecbcbd3d5d3e659ddf20add456982dcb960d3d/src/backend/model/threading/MetadataLoader.ts#L114

  3. image-size to get the photo dimension if 2) ts-exif-parser fails: https://github.com/bpatrik/pigallery2/blob/36ecbcbd3d5d3e659ddf20add456982dcb960d3d/src/backend/model/threading/MetadataLoader.ts#L169 (The image dimension is a must for this app to work properly )

  4. ts-node-iptc for GPS/location, keywords, caption related info: https://github.com/bpatrik/pigallery2/blob/36ecbcbd3d5d3e659ddf20add456982dcb960d3d/src/backend/model/threading/MetadataLoader.ts#L177

  5. exifreader for faces and now for orientation as this lib parses that properly https://github.com/bpatrik/pigallery2/blob/36ecbcbd3d5d3e659ddf20add456982dcb960d3d/src/backend/model/threading/MetadataLoader.ts#L206

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)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bpatrikcommented, Apr 30, 2021

Thank you, @mattiasw for your library. I think that is the best candidate for pigallry2 to have “one exif reader to rule them all”.

So far I’m not planning to put effort in it on my side. I opened this bug if anyone feels the power to implement it 😃 We already have some unit tests in place for the Metadata loader , so a refactor should be relatively safe.

0reactions
bpatrikcommented, Jul 7, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

metadata-ts-loader
metadata-ts-loader. A Webpack loader for extracting typescript metadata (interface, comments jsDoclets, etc) defined in TypeScript.
Read more >
tsc - Is there any clean up command in TypeScript to delete ...
I have a 'src' folder for all my '.ts' files & 'js-files' folder for all the typescript compiler generated '.js' files. So, I ......
Read more >
Disk cleanup in Windows
To delete temporary files: In the search box on the taskbar, type disk cleanup, and select Disk Cleanup from the list of results....
Read more >
waay weather forecast
NDOT crews overnight cleanup of Broadway Broadway in Nashville / 1 hour ago. ... Your best resource for Waay-Am Huntsville AL weather forecasts, ......
Read more >
Community Cleanup | Plano, TX - Official Website
Help keep Plano clean and beautiful by organizing a litter cleanup and/or reserving the community cleanup trailer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found