Skip to content

Commit

Permalink
Merge pull request #279 from 6by9/PR20160105
Browse files Browse the repository at this point in the history
Fixes for #34 and #142
  • Loading branch information
popcornmix committed Jan 7, 2016
2 parents 95cd3f6 + 1d2a203 commit aa66ccc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion host_applications/linux/apps/raspicam/RaspiCamControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static COMMAND_LIST cmdline_commands[] =
{CommandSaturation, "-saturation","sa", "Set image saturation (-100 to 100)", 1},
{CommandISO, "-ISO", "ISO","Set capture ISO", 1},
{CommandVideoStab, "-vstab", "vs", "Turn on video stabilisation", 0},
{CommandEVComp, "-ev", "ev", "Set EV compensation", 1},
{CommandEVComp, "-ev", "ev", "Set EV compensation - steps of 1/6 stop", 1},
{CommandExposure, "-exposure", "ex", "Set exposure mode (see Notes)", 1},
{CommandAWB, "-awb", "awb","Set AWB mode (see Notes)", 1},
{CommandImageFX, "-imxfx", "ifx","Set image effect (see Notes)", 1},
Expand Down
19 changes: 19 additions & 0 deletions host_applications/linux/apps/raspicam/RaspiStill.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,25 @@ static int parse_cmdline(int argc, const char **argv, RASPISTILL_STATE *state)
int len = strlen(argv[i + 1]);
if (len)
{
//We use sprintf to append the frame number for timelapse mode
//Ensure that any %<char> is either %% or %d.
char *percent = argv[i+1];
while(valid && *percent && (percent=strchr(percent, '%')) != NULL)
{
int digits=0;
percent++;
while(isdigit(*percent))
{
percent++;
digits++;
}
if(!((*percent == '%' && !digits) || *percent == 'd'))
{
valid = 0;
fprintf(stderr, "Filename contains %% characters, but not %%d or %%%% - sorry, will fail\n");
}
percent++;
}
state->filename = malloc(len + 10); // leave enough space for any timelapse generated changes to filename
vcos_assert(state->filename);
if (state->filename)
Expand Down

0 comments on commit aa66ccc

Please sign in to comment.