metadata-extractor icon indicating copy to clipboard operation
metadata-extractor copied to clipboard

readMetadata(inputStream) : Need to stop stream when a image EXIF detected.

Open doopedia opened this issue 5 years ago • 2 comments

To fetch exif from a image on another domain, you have to download the whole image.

For a exif, we only need a first few(?) bytes, so I hope there will a feature that read first few streams and stop it when exif is fetched. I know exif is not always in the head of file. But I believe it worths try.

https://stackoverflow.com/questions/13861581/get-exif-data-without-downloading-whole-image-python There's some else with same interest.

In a public cloud, the object storage(AWS S3, Azure Blob ...) is much cheaper so you have to use it. But they serve files as different domain. So this feature is very needed.

doopedia avatar Apr 23 '19 15:04 doopedia

Agree completely, and that's the intent. IIRC there's some code that attempts to validate an offset is within range, which then tries to get the length of the stream in order to compare against it. In order to get the length it buffers the whole image in memory (which brings other problems too). This process could be smarter (for example, only reading until the offset)

drewnoakes avatar May 31 '19 03:05 drewnoakes

Any steps were made regarding the issue?

vicmosin avatar Apr 30 '20 08:04 vicmosin