Comments (1)
For now, we might be able to extend the Exifr
class and inject the corresponding parser manually (based on image type detected by sharp).
Super dirty examplary code:
import { Exifr } from 'exifr';
const formatMap = {
jpeg: 'JpegFileParser'
// ...
};
class CustomExifr extends Exifr {
constructor(parser, options) {
this.fileParser = parser;
super(options);
}
}
// sharp stuff
if (sharpMetadata.exif) {
const parserType = formatMap[sharpMetadata.format];
if (parserType) {
// try...catch
const Parser = (await import(`exifr/file-parsers/${sharpMetadata.format}`)).[parserType];
const exifr = new CustomExifr(new Parser(/* <need to look into parser options> */), exifrOptions);
await exifr.read(sharpMetadata.exif);
const exifData = await exifr.parse();
//
}
//
}
//
No idea whether a) those classes are indeed exported and available b) this would be sufficient or still too few / wrong data for exifr
to process...
Obivously, if this approach would work and with the agreement of @MikeKovarik, we could then handle this in exifr
itself (happy to come up with a PR in that case).
from exifr.
Related Issues (20)
- Missing/wrong Rating meta? HOT 2
- Parsing makerNote tag HOT 5
- Missing some tag data HOT 1
- Can't load fs and zlib HOT 1
- Unable to get lens model number for Nikon camera, I'm sure it's stored in MakerNote
- Why doesn't appear on jpg pages?
- exifr leaks File Descriptors on error
- Exifr fails to read PNG image parameters if the field is 1000+ characters HOT 1
- exifr.gps -> NaN on ios 15 - desktop and android 13 are fine
- Error: ICC header is too short on AVIF image HOT 1
- JPG ifd1 ThumbnailOffset was lost 12 byte
- Automate transcoding of userComment string value
- Support for recent accessibility IPTC fields HOT 4
- Getting more data than what's set with `pick`
- Getting `[Error: Invalid input argument]` when parsing a Blob HOT 1
- IPTC data written as UTF8 incorrectly read HOT 2
- When parsing values โโwritten in XML, numbers longer than 18 characters are not displayed correctly. HOT 1
- Parse Google Pixel MakerNote HOT 1
- Parsing IPTC from TIFF throws error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exifr.