The error means it could find the file. The you don't put a path on the file, it will expect to find it in the current directory. If you ran chdkptp from the command prompt, that will be what ever directory you were in when you ran it.
Specifying the full path should work, but \ is an escape character, so you should either use / instead, or double the backslashes.
Ok, I got it to work with a DNG file created by CHDK, and I get
> !require'hackcfa';hackcfa('s5.dng','s5out.dng',0x01020001)
s5.dng old cfa=0x01000201
s5out.dng new cfa=0x01020001
Also, I'm happy to say this has the desired effect on the image as well!
but previously I was using an older version of chdk that only saved raw files, not DNGs so then I was using "dng4ps2" to convert them to dng, these files give me the following when I try this:
> !require'hackcfa';hackcfa('52.dng','52out.dng',0x01020001)
error: call failed:C:\temp\lua\dng.lua:228: ifd outside of data
stack traceback:
[C]: in function 'error'
C:\temp\lua\dng.lua:228: in function 'bind_ifds'
C:\temp\lua\dng.lua:246: in function 'bind_ifds'
C:\temp\lua\dng.lua:370: in function <C:\temp\lua\dng.lua:357>
(tail call): ?
C:\temp\lua\hackcfa.lua:3: in function 'hackcfa'
[string "require'hackcfa';hackcfa('52.dng','52out.dn..."]:1: in main chunk
[C]: in function 'xpcall'
C:\temp\lua\cli.lua:378: in function <C:\temp\lua\cli.lua:375>
(tail call): ?
...
C:\temp\lua\cli.lua:239: in function 'execute'
C:\temp\lua\gui.lua:659: in function 'action'
C:\temp\lua\gui.lua:626: in function <C:\temp\lua\gui.lua:624>
(tail call): ?
[C]: in function 'MainLoop'
C:\temp\lua\gui.lua:681: in function <C:\temp\lua\gui.lua:667>
(tail call): ?
C:\temp\lua\main.lua:227: in main chunk
[C]: in function 'require'
[string "require('main')"]:1: in main chunk
and my sony files give me this:
> !require'hackcfa';hackcfa('sony.dng','sony_out.dng',0x01020001)
error: call failed:C:\temp\lua\dng.lua:246: attempt to perform arithmetic on field 'elsize' (a nil value)
stack traceback:
C:\temp\lua\dng.lua:246: in function 'bind_ifds'
C:\temp\lua\dng.lua:246: in function 'bind_ifds'
C:\temp\lua\dng.lua:370: in function <C:\temp\lua\dng.lua:357>
(tail call): ?
C:\temp\lua\hackcfa.lua:3: in function 'hackcfa'
[string "require'hackcfa';hackcfa('sony.dng','sony_o..."]:1: in main chunk
[C]: in function 'xpcall'
C:\temp\lua\cli.lua:378: in function <C:\temp\lua\cli.lua:375>
(tail call): ?
(tail call): ?
[C]: in function 'xpcall'
C:\temp\lua\cli.lua:239: in function 'execute'
C:\temp\lua\gui.lua:659: in function <C:\temp\lua\gui.lua:656>
(tail call): ?
[C]: in function 'MainLoop'
C:\temp\lua\gui.lua:681: in function <C:\temp\lua\gui.lua:667>
(tail call): ?
C:\temp\lua\main.lua:227: in main chunk
[C]: in function 'require'
[string "require('main')"]:1: in main chunk
I tried looking at hackcfa.lua to see how it worked, but it went completely over my head! Any ideas whats going on with these other DNG files?