drewnoakes / metadata-extractor-dotnet

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Other
944 stars 170 forks source link

General way to get thumbnail from any supported file format #127

Open Diddlik opened 6 years ago

Diddlik commented 6 years ago

Is there a way to get thumbnail from any file (jpeg, raw, mp4/mov) without reading whole file?

twest820 commented 6 years ago

Not sure which sense of any you're looking for but I posted some basic jpeg code for this in #35. A similar approach should work for most raw formats and I would expect mp4/mov, though this may be incorrect as I mostly work with avi. How much of the file actually gets read from disk is a somewhat complex function of the arguments to FileStream..ctor() and the metadata layout but, as a default starting point, you can expect load of at least one buffer's worth of data from the start of file.

See also #111.

Diddlik commented 6 years ago

it works, but not for all files. For example in Olympus RAW (*.orf) there are no ExifThumbnailDirectory...so its not possible to get information about offset and length of thumbnail.

twest820 commented 6 years ago

That's likely because Olympus chose not to conform to the EXIF standard when embedding thumbnails in their raws. You might try looking in the makernote.