fuweichin / image-info-extractor

A JavaScript lib to read image info and to extract/parse image metadata
MIT License
4 stars 0 forks source link

Usage in Node.js #2

Open talentlessguy opened 7 months ago

talentlessguy commented 7 months ago

is there a way to use this in Node.js without reading the whole file like in fast-exif?

fuweichin commented 7 months ago

Actually it works in Node.js when certain requirements are met, I just added some examples, see examples-nodejs/.

Concerning reading file fully or progressively into memory:

For JPEG format, blob/file is read progressively. 64KB data is initially read (Exif metadata are restricted in size to 64 kB in JPEG images), if necessary more and more data will be read until 2MB.

For other formats: progressive reading is planned (with initial buffer size = 64KB, buffer increasing multiplier = 2), it may not necessaryly gain any benifits except instant memory usage, I'll try it later.

talentlessguy commented 7 months ago

Thanks for adding an example! My specific case is parsing AVIF metadata. Seems like there's no other project doing that

I want to extract all the same metadata that JPEG has