Well in theory, I would need to inquiry the camera about which levels of resolution it supports, to be able to specify that '2' from a list of values that are known to work; in my tests, I think the number '1' crashed the camera.
I wouldn't expect 1 to crash. The values vary some between models, but see
http://chdk.wikia.com/wiki/PropertyCaseIn general 0, 1, 2 and 4 should work on all cameras, with 0 being native res, 1 and 2 being some camera dependent smaller sizes and 4 being 640x480.
To find out what the camera supports, you can set the resolution in the canon UI and check the propcase value with get_prop.
Also, I was able to express that in a single line using 'require("propcase").RESOLUTION' but the original piece of code I read to perform this action used variables and two or three lines of code. Is it possible to send a bigger unit of execution to the camera instead of a single expression?
props=require("propcase")
value = 1
status=set_prop(props.RESOLUTION, value)
chdkptp CLI (
including cli:execute) only accept single lines.
edit: My mistake, cli:execute will actually accept multi-line strings, so you could do something like
cli:execute([[luar
props=require("propcase")
value = 1
set_prop(props.RESOLUTION, value)
]])
In Lua, new lines are just a white space, so you could put the second version in one line if you wanted.
If you use con:execwait, you can use mutli-line strings like
con:execwait([[
props=require("propcase")
value = 1
set_prop(props.RESOLUTION, value)
]])
but as I mentioned in the other post, this will have different error handling.