From b1ae9f31ed145ecb0f5d07cb70a03d5b9a9298a3 Mon Sep 17 00:00:00 2001 From: tonton Th Date: Mon, 17 Feb 2020 07:40:06 +0100 Subject: [PATCH] tracking a bug... --- floatimg.h | 2 +- lib/fimg-compare.c | 2 +- lib/interpolate.c | 13 +++++++++---- tools/fimgops.c | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/floatimg.h b/floatimg.h index 5083630..5ee3a33 100644 --- a/floatimg.h +++ b/floatimg.h @@ -2,7 +2,7 @@ * floatimg.h */ -#define FIMG_VERSION 91 +#define FIMG_VERSION 92 /* * in memory descriptor diff --git a/lib/fimg-compare.c b/lib/fimg-compare.c index dbe1755..e89e234 100644 --- a/lib/fimg-compare.c +++ b/lib/fimg-compare.c @@ -15,7 +15,7 @@ extern int verbosity; /* must be declared around main() */ /* ---------------------------------------------------------------- */ int fimg_images_compatible(FloatImg *a, FloatImg *b) { -#if DEBUG_LEVEL +#if DEBUG_LEVEL > 1 fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b); #endif diff --git a/lib/interpolate.c b/lib/interpolate.c index c1a36b6..737c48b 100644 --- a/lib/interpolate.c +++ b/lib/interpolate.c @@ -41,23 +41,28 @@ int fimg_interpolate(FloatImg *s1, FloatImg *s2, FloatImg *d, float coef) { int foo; +#if DEBUG_LEVEL +fprintf(stderr, ">>> %s ( %p %p %p %f )\n", __func__, + s1, s2, d, coef); +#endif + foo = fimg_images_compatible(s1, s2); if (foo) { - fprintf(stderr, "compat -> %d\n", foo); + fprintf(stderr, "compat s1 s2 -> %d\n", foo); return foo; } foo = fimg_images_compatible(s1, d); if (foo) { - fprintf(stderr, "compat -> %d\n", foo); + fprintf(stderr, "compat s1 d -> %d\n", foo); return foo; } switch (s1->type) { case FIMG_TYPE_GRAY: - gray_interpolate(s1, s2, d, coef); break; + gray_interpolate (s1, s2, d, coef); break; case FIMG_TYPE_RGB: - rgb_interpolate(s1, s2, d, coef); break; + rgb_interpolate (s1, s2, d, coef); break; default: fprintf(stderr, "%s, %d is a bad type\n", __func__, s1->type); return -18; diff --git a/tools/fimgops.c b/tools/fimgops.c index e536342..02f17bf 100644 --- a/tools/fimgops.c +++ b/tools/fimgops.c @@ -95,6 +95,7 @@ switch (action) { case OP_MAXI: foo = fimg_minimum(A, B, D); break; default: + fprintf(stderr, "fscking action #%d\n", action); foo = -99; break; }