aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2023-01-06 11:31:33 +0200
committerIgor Pashev <pashev.igor@gmail.com>2023-01-06 15:02:21 +0200
commitbf2cad5d37a17bcc7563acb84291ea4ffcb06d0c (patch)
treee343c4d66294709b0f518d3284a0226976155d03
parentf3b3e8ecf58611c8a3cca17d3a94e8ae23ba7788 (diff)
downloadiscan-bf2cad5d37a17bcc7563acb84291ea4ffcb06d0c.tar.gz
Fix build with libpng16
-rw-r--r--configure.ac1
-rw-r--r--frontend/Makefile.am1
-rw-r--r--lib/pngstream.cc5
3 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f8907fa..d2739af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,6 +139,7 @@ AC_ARG_ENABLE(gimp,
dnl checks for libraries
+PKG_CHECK_MODULES(LIBPNG, libpng16)
PKG_CHECK_MODULES(XML, libxml-2.0)
PKG_CHECK_MODULES(LIBUSB_1_0, libusb-1.0,
[
diff --git a/frontend/Makefile.am b/frontend/Makefile.am
index 6d7c132..109246e 100644
--- a/frontend/Makefile.am
+++ b/frontend/Makefile.am
@@ -36,6 +36,7 @@ iscan_LDADD = \
-lsane \
@LIBLTDL@ \
@GTK_LIBS@ \
+ @LIBPNG_LIBS@ \
@GDK_IMLIB_LIBS@ \
$(top_builddir)/non-free/libesmod.so
iscan_SOURCES = \
diff --git a/lib/pngstream.cc b/lib/pngstream.cc
index d9344b4..e3e49eb 100644
--- a/lib/pngstream.cc
+++ b/lib/pngstream.cc
@@ -83,7 +83,8 @@ namespace iscan
#if HAVE_PNG_H
set_error_handler (_png, _info);
- if (_header && !_footer && _png->num_rows == _png->flush_rows)
+ lib->write_flush (_png);
+ if (_header && !_footer)
{
lib->write_end (_png, _info);
_footer = true;
@@ -118,7 +119,7 @@ namespace iscan
// to a "file not found" error when calling dlopen. We just
// dlopen the libz library explicitly to work around this.
basic_imgstream::dlopen ("libz");
- basic_imgstream::dlopen ("libpng12", validate);
+ basic_imgstream::dlopen ("libpng16", validate);
}
catch (std::runtime_error& e)
{