Want to extract thumbnails from raw files folder

Started by PatD, March 20, 2024, 10:17:54 AM

Previous topic - Next topic

PatD

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.

Phil Harvey

The command could be something like this:

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

PatD

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?

PatD

-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

Phil Harvey

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)

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

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 (Windows) or XNView (multi-platform) to create JPEGs from RAW files. Both have batch processing, IIRC.

On the command line, you would want to use ImageMagick (multi-platform).
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

PatD

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.