CHDK DNG header structure - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

CHDK DNG header structure

  • 13 Replies
  • 7841 Views
Re: CHDK DNG header structure
« Reply #10 on: 05 / December / 2010, 06:50:52 »
Advertisements
Quote
Thy this,  it should do the trick for you:

and maybe not  :)

Remember, LEFT and RIGHT only occur at the lowest level, not in all subfolders.

Code: [Select]
for /D %%A in (*) do call :doCopy "%%A"

That presumably passes the path of all folders and subfolders to the subroutine ?


Quote
cd %~1%\LEFT

We need to ignore if that subfolder does not exist at that level.

I tried the following but it does not work  :-

Code: [Select]
do IF EXIST "%%A\LEFT" call :doCopy "%%A"
« Last Edit: 05 / December / 2010, 07:07:58 by Microfunguy »

Re: CHDK DNG header structure
« Reply #11 on: 05 / December / 2010, 08:04:03 »
It is not elegant but this creates the DNG's and then uses IrfanView to convert to PNG's  :-

Code: [Select]
@echo off
dir .. /ad  /b /s >temp
findstr /e "\RIGHT \LEFT" temp > temp2
for /F "delims=" %%d in (temp2) do (
cd "%%d"
for %%f in (*.raw) do copy /b strips.hdr + %%f %%~nf.dng > NUL
del *.raw
del strips.hdr
for %%a in (*.dng) do (
echo .
PATH="%PROGRAMFILES%\irfanview"
i_view32.exe %%~na.dng /convert=%%~na.png)
for %%a in (*.png) do echo %%~fa >> ../../../files.txt
)
cd ../../../
del temp
del temp2
del /s *.jpg > NUL
del /s *.dng > NUL
i_view32.exe /slideshow=%CD%\files.txt /closeslideshow


« Last Edit: 05 / December / 2010, 15:31:46 by Microfunguy »

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: CHDK DNG header structure
« Reply #12 on: 05 / December / 2010, 10:06:51 »
Code: [Select]
for /D %%A in (*) do call :doCopy "%%A"
That presumably passes the path of all folders and subfolders to the subroutine ?
It passes the names of the subfolders, such as "3350", "3351", ... in your case.

Quote
We need to ignore if that subfolder does not exist at that level.
I tried the following but it does not work  :-
Code: [Select]
do IF EXIST "%%A\LEFT" call :doCopy "%%A"
Try IF EXIST in the subroutine, not in the main loop. Or rather IF NOT EXIST ... GOTO :LABEL
IF EXIST body may contain several commands, which you enclose in (...), such as
Code: [Select]
if not exist "%~dp1*.raw" (
  echo No RAW files, exiting...
  goto :pause
)

Quote
Remember, LEFT and RIGHT only occur at the lowest level, not in all subfolders.
I assumed your directory structure was this:
Consider the following directory structure :-

DCIM/
         3350/LEFT/
                /RIGHT/
         3353/LEFT/
                /RIGHT/
         3356/LEFT/
                /RIGHT/

The LEFT and RIGHT folders contain images (3350_001.RAW, 3350_002.RAW and 3350_003.RAW, for example).
Each folder also contains file STRIPS.HDR.

Re: CHDK DNG header structure
« Reply #13 on: 05 / December / 2010, 14:13:03 »
The above code is now modified to run a slide-show of the converted image strips.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal