ExifTool Forum

General => Metadata => Topic started by: greybeard on October 16, 2023, 09:01:57 AM

Title: Extracting Thumbnail Images
Post by: greybeard on October 16, 2023, 09:01:57 AM
I am writing an application to read SD cards containing raw image files from digital cameras and show thumbnails as a grid. Cards may be slow so this needs to be a very efficient process to be useable.

I'm trying to avoid reading the entire, possibly large, raw file and just extract the thumbnail.

Exiftool may not be the solution as I want the application to run on platforms that don't easily support perl (such as iOS and iPadOS).

Sony (ARW) and FujiFilm (RAF) images seem relatively straightforward but many other raw formats don't seem to contain thumbnails in a normal readable jpeg format - in many cases Exiftool seems to synthesize the thumbnails rather than simply extracting them (Nikon NEF files for example).

It must be possible to achieve this as the major operating systems are able to quickly show thumbnail images from raw formats that they support.

Any suggestions or thoughts?
Title: Re: Extracting Thumbnail Images
Post by: Phil Harvey on October 16, 2023, 09:18:38 AM
ExifTool generates a ThumbnailTIFF for some image types, but for NEF the thumbnail is an embedded JPEG that is easily extracted from one of the SubIFD's.

If you want the best speed, I think you are doing it the right way.  There may be libraries that will do this for you more easily, but they will always be slower than an optimized approach.

- Phil
Title: Re: Extracting Thumbnail Images
Post by: greybeard on October 16, 2023, 09:26:46 AM
Thanks for the quick response Phil - maybe there are different types of NEF file from different models?

I downloaded a sample from a D6 and Exiftool reported a generated ThumbnailTIFF in the IFD0 group.

The SubIFDs have JpgFromRaw and OtherImage - both are larger than I would expect for a thumbnail.
Title: Re: Extracting Thumbnail Images
Post by: Phil Harvey on October 16, 2023, 09:35:27 AM
You're probably right that different models store this differently.  I only checked for one sample (Z9 as it turns out), and I shouldn't have generalized.

- Phil