asm1989
To be able to save in the same directory as jpg I had to modify code at raw.c in raw_savefile() , just bellow
[code] mkdir("A/DCIM");[/code]
[code] #if defined (CAMERA_sx210is)
if (conf.raw_in_dir) {
int month;
struct tm *ttm;
unsigned long t;
t = time(NULL);
ttm = localtime(&t);
month = ttm->tm_mon + 1;
sprintf(dir, "A/DCIM/%03d___%02d", get_target_dir_num(), month);
}
else
sprintf(dir, "A/DCIM/%03dRAW", get_target_dir_num());[/code]
For the
SX30 and
G12 I have found a firmware function that builds the correct directory name, taking into account the menu option to name the folder daily or monthly.
In both these cameras the function is located just before the string "GetCameraObjectTmpPath ERROR" in the firmware.
The code I am using is:
stubs_entry_2.s (the address will need to be updated):
NHSTUB(GetImageFolder, 0x????????) // function before 'GetCameraObjectTmpPath ERROR' string
shooting.c:
// G12 uses date to name directory
void get_target_dir_name(char *out)
{
extern void _GetImageFolder(char*,int,int,int);
out[0] = 'A';
_GetImageFolder(out+1,get_file_next_counter(),0x400,time(NULL));
}
raw.c:
if (conf.raw_in_dir)
get_target_dir_name(dir);
else
sprintf(dir, RAW_TARGET_DIRECTORY, 100);
The parameters to the function I named 'GetImageFolder' are:
- buffer to store result
- current file counter value
- control to specify what filename type to append (0x400 gives just the directory name)
- current time stamp
Hope this helps,
Phil.