Creating Thumbnails: dcraw and ImageMagick in a Batch File (2)
Usage for RAW files.
- If not installed, download and install dcraw and ImageMagick
- Create a batch file as listed below
- Open: Edit > Settings > Thumbnails
- Check Create thumbnails with own external program
- Write into the text field under External image creation application:
"Path_to_Batch_file" "%s" %i
where"Path_to_Batch_file"
is something like"C:\Batch\dcraw.bat"
(the folder path where the batch file is stored included the batch file name)
Batch File
Written by Matthias Vonken. You have to fit the paths to dcraw.exe
and
convert.exe
.
@echo off set IMAGE=%1 set MAX_DIM=%2 rem Extracting image suffix for %%i in (%IMAGE%) DO set THUMB_SUFFIX=%%~xi rem Deciding whether RAW or not if /I "%THUMB_SUFFIX%" ==".gif" GOTO OTHER if /I "%THUMB_SUFFIX%" ==".jpg" GOTO OTHER if /I "%THUMB_SUFFIX%" ==".tif" GOTO OTHER "C:\dcraw\dcraw.exe" -e -c %IMAGE% | "C:\Program Files\ImageMagick-6.6.9-Q16\convert.exe" - -thumbnail %MAX_DIM%x%MAX_DIM% -auto-orient jpg:- goto END :OTHER "C:\Program Files\ImageMagick-6.6.9-Q16\convert.exe" %IMAGE% -thumbnail %MAX_DIM%x%MAX_DIM% -auto-orient jpg:- :END
Author: Elmar Baumann
Write e-Mail
Status of this document: 2011-05-05