From 4e841e7a8592ca406235ecf181245dba0b0c5e30 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 8 Dec 2010 16:18:37 -0700 Subject: Make PNG and TIFF tests work --- config.h.in | 6 ++++++ configure | 9 ++++++++- configure.ac | 6 +++++- src/render.c | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/config.h.in b/config.h.in index bfb065a4..a1c63a32 100644 --- a/config.h.in +++ b/config.h.in @@ -41,6 +41,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if libPNG is available */ +#undef HAVE_LIBPNG + /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC @@ -142,6 +145,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if libTIFF is available */ +#undef HAVE_TIFF + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H diff --git a/configure b/configure index 38d96fc4..7d1dd6b4 100755 --- a/configure +++ b/configure @@ -6626,7 +6626,11 @@ else libPNG_LIBS=$pkg_cv_libPNG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - havelibpng=true + + +$as_echo "#define HAVE_LIBPNG 1" >>confdefs.h + + fi else @@ -6658,6 +6662,9 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +$as_echo "#define HAVE_TIFF 1" >>confdefs.h + + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 diff --git a/configure.ac b/configure.ac index 2a58233a..07572696 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,10 @@ AC_ARG_ENABLE([png], AS_IF([test "x$enable_png" != "xno"], [ AC_MSG_RESULT([yes]) - PKG_CHECK_MODULES([libPNG], [libpng >= 1.2.0], [havelibpng=true]) + PKG_CHECK_MODULES([libPNG], [libpng >= 1.2.0], + [ + AC_DEFINE([HAVE_LIBPNG], [1], [Define to 1 if libPNG is available]) + ]) ],[ AC_MSG_RESULT([no]) ]) @@ -117,6 +120,7 @@ AS_IF([test "x$enable_tiff" != "xno"], LIBTIFF_LIBS="-L$withval/lib -ltiff"], [LIBTIFF_LIBS="-ltiff"]) AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_TIFF], [1], [Define to 1 if libTIFF is available]) ], [ AC_MSG_RESULT([no]) diff --git a/src/render.c b/src/render.c index 98fb693d..0051780d 100644 --- a/src/render.c +++ b/src/render.c @@ -465,7 +465,7 @@ int render_tiff_fp(DisplayWindow *dw, const char *filename) if ( image == NULL ) return 1; image->features = NULL; image->data = NULL; - hdf5_read(dw->hdfile, image, 1); + hdf5_read(dw->hdfile, image, 1, 0.0); if ( dw->cmfilter ) filter_cm(image); if ( dw->noisefilter ) filter_noise(image, NULL); @@ -514,7 +514,7 @@ int render_tiff_int16(DisplayWindow *dw, const char *filename) if ( image == NULL ) return 1; image->features = NULL; image->data = NULL; - hdf5_read(dw->hdfile, image, 1); + hdf5_read(dw->hdfile, image, 1, 0.0); if ( dw->cmfilter ) filter_cm(image); if ( dw->noisefilter ) filter_noise(image, NULL); -- cgit v1.2.3