From 77016401db45f5038be8891abeae45ad51597f3d Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 13 Jan 2009 10:29:29 +0000 Subject: [PATCH] storyboard.c: tuned the output file name. examples/.gitignore: ignore storyboard. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3347 92316355-f0b4-4df1-b90c-862c8a59935f --- examples/.gitignore | 1 + examples/storyboard.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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);