diff --git a/examples/.gitignore b/examples/.gitignore index e6be122..d317853 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -6,4 +6,5 @@ histogram img2rubik line sharpen +storyboard *.exe diff --git a/examples/storyboard.c b/examples/storyboard.c index b8ee9c3..f11e13e 100644 --- a/examples/storyboard.c +++ b/examples/storyboard.c @@ -50,12 +50,12 @@ int main(int argc, char *argv[]) if(argc < 2) return EXIT_FAILURE; - strcpy(fmtstr, argv[1]); + parser = strrchr(argv[1], '/'); + strcpy(fmtstr, parser ? parser : argv[1]); parser = strrchr(fmtstr, '.'); if(parser) - strcpy(parser, "%03i.jpeg"); - else - strcat(fmtstr, "%03i.jpeg"); + *parser = '\0'; + strcat(fmtstr, ".%03i.jpeg"); image = pipi_new(TWIDTH * TCOLS, THEIGHT * TROWS); p = pipi_get_pixels(image, PIPI_PIXELS_RGBA_U8);