mattiasw/ExifReader

Can I add options to avoid loading the entire file

Closed this issue · 6 comments

HI Mattias!
Whether it can be displayed in ExifReader.load adds an option to control how much data the network request receives to save the traffic of the request.

Hi! It wasn't possible but now it is! :-) Just released that functionality as version 4.9.0. That was a great idea, thanks! I think other users will be happy too because reading only part of the file is a recurring request.

To use it, add length as an option like this:

const tags = await ExifReader.load(filename, {length: 128 * 1024});

Thanks for adding this, it helped speed up load times on my AstroJS site during dev. 👍

Hi, I just upgraded to v4.9.0 to test this (with TypeScript) but my IDE doesn't pick up the new option.

The type definitions usually rely on pull requests. I seldom update them myself because I'm simply not very good at it. That being said, does the following change look OK? I saw another option was also missing so I added that one too.

#217

That being said, does the following change look OK?

I'm still fairly new to TypeScript but those changes look good to me.

Released as version 4.9.1.