From f61f428066747e575bf1b7750940faca0ee407ef Mon Sep 17 00:00:00 2001 From: le vieux Date: Fri, 20 Nov 2020 19:06:08 +0100 Subject: [PATCH] output dir option is NOW working (maybe) --- Fonderie/fonderie.c | 23 +++++++++++++---------- Fonderie/t.c | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Fonderie/fonderie.c b/Fonderie/fonderie.c index 4dd688cd..4ab6e4b3 100644 --- a/Fonderie/fonderie.c +++ b/Fonderie/fonderie.c @@ -17,7 +17,7 @@ int verbosity; int convert_to_gray; /* -------------------------------------------------------------- */ -int traite_une_image(FloatImg *image, int proc, int step) +int traite_une_image(FloatImg *image, int proc, int step, char *outd) { static int numero; int foo; @@ -29,10 +29,7 @@ if (foo) { fprintf(stderr, "%s: err %d on insert\n", __func__, foo); return foo; } -sprintf(ligne, "p8/%05d.png", numero); -/* ^^^ - XXX hardcoded value ? wtf ? - */ +sprintf(ligne, "%s/%05d.png", outd, numero); foo = export_fifo(ligne, proc, step); if (foo) { fprintf(stderr, "%s: err %d on export\n", __func__, foo); @@ -42,7 +39,8 @@ numero++; /* VERY IMPORTANT :) */ return 0; } /* -------------------------------------------------------------- */ -int insert_blank(FloatImg *image, int nbre, int pproc, float fval) +int insert_blank(FloatImg *image, int nbre, int pproc, + float fval, char *outd) { int idx, foo; @@ -50,7 +48,7 @@ fimg_clear(image); for (idx=0; idx %d\n", szfifo, foo); /* XXX inject a few strange pics in the fifo */ -insert_blank(&input, BLANK, outfx, maxvalue); +insert_blank(&input, BLANK, outfx, maxvalue, outdir); for (idx=0; idx %d\n", __func__, foo); exit(1); } - foo = traite_une_image(&input, outfx, step); + foo = traite_une_image(&input, outfx, step, outdir); if (foo) { fprintf(stderr, "traitement %s -> %d WTF?\n", cptr, foo); break; @@ -142,7 +140,7 @@ for (idx=0; idx %d\n", foo); diff --git a/Fonderie/t.c b/Fonderie/t.c index 59485056..949aca80 100644 --- a/Fonderie/t.c +++ b/Fonderie/t.c @@ -51,7 +51,7 @@ for (iter=0; iter<72; iter++) { if (foo) abort(); } - sprintf(buff, "out%03d.png", iter); + sprintf(buff, "/tmp/out%03d.png", iter); foo = fimg_save_as_png(&image, buff, 0); if (foo) { fprintf(stderr, "err %d saving to '%s'\n", foo, PNG);