From 2a2bc51e70052b03e9c896ac06925362a002f512 Mon Sep 17 00:00:00 2001 From: tonton th Date: Wed, 24 Feb 2021 12:35:31 +0100 Subject: [PATCH] using autoshift to zero --- Fonderie/crapulator.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 22a7010..582ffeb 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -126,11 +126,21 @@ if (retval) { fprintf(stderr, "%s error %d on filter\n", __func__, retval); exit(1); } + +foo = fimg_auto_shift_to_zero(&img, &img); +if (foo) { + fprintf(stderr, "%s: err %d zero shift\n", __func__, foo); + exit(1); + } + /** may be, we can check for negative values ? */ +/** or is this useless because whe have shifted to zero ? */ if (verbosity > 1) { foo = fimg_count_negativ(&img); - fprintf(stderr, "%s -> %d / %d negative pixels\n", __func__, - foo, img.width*img.height); + if (foo) { + fprintf(stderr, "%s -> %d / %d negative pixels\n", __func__, + foo, img.width*img.height); + } } fimg_killborders(&img);