Používám foťák Canon A630 s firmwarem CHDK, díky kterému mohu fotit i do RAWu. I pouhá mechanická konverze těchto RAWů do JPG vytvoří kvalitnější výsledek než JPG přímo z foťáku. Chtěl jsem, aby se mi tahle mechanická činnost provedla co nejjednodušeji. Výsledek je použití dávkového souboru a IrfanView s pluginy:
@echo off
cls
setlocal
:: --- Configuration --->
:: Path to IrfanView
set iview=D:\Program Files\Grafika\IrfanView\IrfanViewPortable.exe
:: Source path
set source=
:: Target path
set target=.\out
:: Suffix of the source files
set ssuffix=DNG
:: Suffix of the target files
set tsuffix=JPG
:: <--- Configuration ---
echo Converting all %ssuffix% files to %target%\ %tsuffix% via Irfanview
echo Path to Irfanview set: %iview%
echo --------------------------------------------------------------------
set STARTTIME=%TIME%
for %%a in ("*.%ssuffix%") do call :CONVERT "%%a"
goto ENDE
:CONVERT
:"%iview%" %1 /sharpen=7 /silent /ini=%~dp0\i_view32.ini /jpgq=82 /convert="%target%\%~n1.%tsuffix%"
"%iview%" %1 /sharpen=7 /AdvSaveOldDate=1 /silent /jpgq=82 /convert="%target%\%~n1.%tsuffix%"
echo %~1
goto :EOF
:ENDE
set ENDTIME=%TIME%
rem convert STARTTIME and ENDTIME to centiseconds
set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100)
set /A ENDTIME=(1%ENDTIME:~0,2%-100)*360000 + (1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 + (1%ENDTIME:~9,2%-100)
rem calculating the duratyion is easy
set /A DURATION=%ENDTIME%-%STARTTIME%
rem we might have measured the time inbetween days
if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME%
rem now break the centiseconds down to hors, minutes, seconds and the remaining centiseconds
set /A DURATIONH=%DURATION% / 360000
set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
set /A DURATIONHS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000 - %DURATIONS%*100)
rem some formatting
if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
if %DURATIONHS% LSS 10 set DURATIONHS=0%DURATIONHS%
echo Finished in %DURATIONH%:%DURATIONM%:%DURATIONS%,%DURATIONHS%
endlocal
Mas to tady moc pekny! :)