Hi ppl,
I'm a total chdk rookie. In fact I bought a a470 a couple of days ago since I really wanted to try chdk out, and that camera is dirt cheap right now. When I noticed the a470 was supported I bought one right away. Thanks for the port, MrSpoon!

I had a look at the RAW cropping problem, and it seems it's just a couple of overlooked #define statements (from copy/paste probably). I looked at other cameras and fixed the problem. The X size is verified through experimentation, any bigger and dead pixels appear. It MIGHT be possible to get a couple more pixels vertically, but it's really close to the limit so I didn't test this. It's bigger than the JPG anyway now so..

Note that I've only checked the resulting .DNG files out. I don't have any software for reading .RAW or .CRW so someone could maybe check this, just in case. Should be fine though.
Here's my patch:
Index: include/camera.h
=============================================================================
--- include/camera.h (revision )
+++ include/camera.h (working copy)
@@ -230,8 +230,8 @@
#define CAM_JPEG_HEIGHT 1944
#define CAM_ACTIVE_AREA_X1 6
#define CAM_ACTIVE_AREA_Y1 6
- #define CAM_ACTIVE_AREA_X2 2618
- #define CAM_ACTIVE_AREA_Y2 1962
+ #define CAM_ACTIVE_AREA_X2 3108
+ #define CAM_ACTIVE_AREA_Y2 2334
// camera name
#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
//#define DNG_EXT_FROM ".DPS"
I've tested it on my a470 ver. 1.02c, but of course I take no responsibility and so on. That said, I put up compiled versions of my patched chdk build here:
http://nostalgia.suroot.com/a470-0.9.8-766-rawfixI'll leave it up until the svn code is fixed and it gets into the autobuild.
It might be a good idea to re-create your badpixel.bin.
Again, Thanks to everyone involved in the chdk project and in the a470 port!!
EDIT 2009-05-28:
The coordinates were still slightly off, resulting in black line and/or incorrect pixels at the borders. I've cropped it a tiny bit now to exactly match what I see when magnifying a picture. Maybe someone else could confirm it looks good at the edges with their cam too.
New diff (against original 766 trunk)
Index: include/camera.h
=============================================================================
--- include/camera.h (revision )
+++ include/camera.h (working copy)
@@ -228,10 +228,10 @@
// cropping
#define CAM_JPEG_WIDTH 2592
#define CAM_JPEG_HEIGHT 1944
- #define CAM_ACTIVE_AREA_X1 6
- #define CAM_ACTIVE_AREA_Y1 6
- #define CAM_ACTIVE_AREA_X2 2618
- #define CAM_ACTIVE_AREA_Y2 1962
+ #define CAM_ACTIVE_AREA_X1 12
+ #define CAM_ACTIVE_AREA_Y1 8
+ #define CAM_ACTIVE_AREA_X2 3108
+ #define CAM_ACTIVE_AREA_Y2 2332
// camera name
#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
//#define DNG_EXT_FROM ".DPS"
New binaries (previous ones taken down) :
http://nostalgia.suroot.com/a470-0.9.8-766-rawfix2/Hav fun
