ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: PatD on March 20, 2024, 10:17:54 AM

Title: Want to extract thumbnails from raw files folder
Post by: PatD on March 20, 2024, 10:17:54 AM
Newbie here.

I want to execute an EXIFTool command from a C# Winforms program to extract the thumbnails from a folder as JPG images and write them to a file with the same name plus a suffix, such as thumb, in a different folder. I used Brain2CPU.ExifTool to extract EXIF data but couldn't see a way to get thumbnails in that library. So, I wondered if I could use ExifTool directly. I should be able to execute a command line command from my code.
Title: Re: Want to extract thumbnails from raw files folder
Post by: Phil Harvey on March 20, 2024, 11:44:06 AM
The command could be something like this:

exiftool -thumbnailimage -b -w OTHER_FOLDER/%f_thumb.jpg DIR

- Phil
Title: Re: Want to extract thumbnails from raw files folder
Post by: PatD on March 20, 2024, 12:13:57 PM
Thanks. That works and it is very fast. If I also wanted JPG images to be extracted, how would I do that? Also, can I specify the RAW extension in the command?
Title: Re: Want to extract thumbnails from raw files folder
Post by: PatD on March 20, 2024, 09:40:04 PM
-thumbnailimage works, but -jpgfromraw doesn't produce any files. Is it possible to convert RAW files to JPG copies?


C:\Temp\Temp>exiftool -jpgfromraw -b -w C:\Temp\Temp\Temp/"%f_jpg.jpg" I:\RawPictures\Aircraft\AirShow15\Raw
    1 directories scanned
  107 image files read
    0 output files created

C:\Temp\Temp>exiftool -thumbnailimage -b -w C:\Temp\Temp\Temp/"%f_jpg.jpg" I:\RawPictures\Aircraft\AirShow15\Raw
    1 directories scanned
  107 image files read
  107 output files created
Title: Re: Want to extract thumbnails from raw files folder
Post by: Phil Harvey on March 20, 2024, 09:52:51 PM
You can extract all preview images like this:

exiftool -preview:all -a -b -W OTHER_FOLDER/%f_%t%-c.%s DIR

(this is the 9th example here (https://exiftool.org/exiftool_pod.html#READING-EXAMPLES))

ExifTool only extracts previews that exist.  I doesn't do conversions.

- Phil
Title: Re: Want to extract thumbnails from raw files folder
Post by: StarGeek on March 25, 2024, 01:55:15 PM
Quote from: PatD on March 20, 2024, 09:40:04 PMIs it possible to convert RAW files to JPG copies?

You can use programs like Irfanview (https://www.irfanview.com/) (Windows) or XNView (https://www.xnview.com/en/) (multi-platform) to create JPEGs from RAW files. Both have batch processing, IIRC.

On the command line, you would want to use ImageMagick (https://imagemagick.org/) (multi-platform).
Title: Re: Want to extract thumbnails from raw files folder
Post by: PatD on March 25, 2024, 08:09:13 PM
Thanks.

It turns out that the preview images from Sony RAW files met my needs for something larger than a thumbnail but not the full image size. At 1616x1080, the preview images look good on a monitor. ExitTool's -preview:PreviewImage does what I wanted. I'll have to check Canon, Nikon etc. to see what their preview images are like,

I'm using ImageMagic from C# to get JPGs from Sony RAW files. It takes a few seconds per image so I only use it at the point where a user wants to see much more detail.