From bec6b174c99bb8121318834b79618cf948447ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Sun, 8 May 2016 22:39:08 +0200 Subject: [PATCH] Fix poppler version requirement, add loader check This fixes the poppler-glib version requirement to version 0.16, which is the lowest version that compiles and works properly with pdfload. Also added a check for pdfload and enabled testing on Travis CI. --- .travis.yml | 2 +- configure.ac | 8 ++++---- test/images/blankpage.pdf | 37 +++++++++++++++++++++++++++++++++++++ test/images/blankpage.png | Bin 0 -> 3795 bytes test/test_formats.sh | 8 ++++++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100755 test/images/blankpage.pdf create mode 100644 test/images/blankpage.png diff --git a/.travis.yml b/.travis.yml index d7d39749..2ca5238d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - sudo apt-get install libpng12-dev libwebp-dev libtiff4-dev libxml2-dev - sudo apt-get install swig libmagick++-dev bc - sudo apt-get install libcfitsio3-dev libgsl0-dev libmatio-dev - - sudo apt-get install liborc-0.4-dev liblcms2-dev + - sudo apt-get install liborc-0.4-dev liblcms2-dev libpoppler-glib-dev before_script: - ./bootstrap.sh - ./configure diff --git a/configure.ac b/configure.ac index 4ddb37fe..7aecb252 100644 --- a/configure.ac +++ b/configure.ac @@ -563,12 +563,12 @@ AC_ARG_WITH([poppler], AS_HELP_STRING([--without-poppler], [build without poppler (default: test)])) if test x"$with_poppler" != x"no"; then - PKG_CHECK_MODULES(POPPLER, [poppler-glib >= 0.30.0 cairo >= 1.2], - [AC_DEFINE(HAVE_POPPLER,1,[define if you have poppler-glib >= 0.30.0 and cairo >= 1.2 installed.]) + PKG_CHECK_MODULES(POPPLER, [poppler-glib >= 0.16.0 cairo >= 1.2], + [AC_DEFINE(HAVE_POPPLER,1,[define if you have poppler-glib >= 0.16.0 and cairo >= 1.2 installed.]) with_poppler=yes PACKAGES_USED="$PACKAGES_USED poppler-glib cairo" ], - [AC_MSG_WARN([poppler-glib >= 0.30.0 or cairo >= 1.2 not found; disabling PDF load via poppler]) + [AC_MSG_WARN([poppler-glib >= 0.16.0 or cairo >= 1.2 not found; disabling PDF load via poppler]) with_poppler=no ] ) @@ -961,7 +961,7 @@ file import with OpenSlide: $with_openslide (requires openslide-3.3.0 or later) file import with matio: $with_matio PDF import with poppler-glib: $with_poppler - (requires poppler-glib 0.30.0 or later) + (requires poppler-glib 0.16.0 or later) SVG import with librsvg-2.0: $with_rsvg (requires librsvg-2.0 2.40.0 or later) file import with cfitsio: $with_cfitsio diff --git a/test/images/blankpage.pdf b/test/images/blankpage.pdf new file mode 100755 index 00000000..5884469c --- /dev/null +++ b/test/images/blankpage.pdf @@ -0,0 +1,37 @@ +%PDF-1.1 +%âãÏÓ +1 0 obj +<< +/Pages 2 0 R +/Type /Catalog +>> +endobj +2 0 obj +<< +/MediaBox [0 0 595 842] +/Kids [3 0 R] +/Count 1 +/Type /Pages +>> +endobj +3 0 obj +<< +/Parent 2 0 R +/MediaBox [0 0 595 842] +/Type /Page +>> +endobj xref +0 4 +0000000000 65535 f +0000000015 00000 n +0000000066 00000 n +0000000149 00000 n +trailer + +<< +/Root 1 0 R +/Size 4 +>> +startxref +221 +%%EOF diff --git a/test/images/blankpage.png b/test/images/blankpage.png new file mode 100644 index 0000000000000000000000000000000000000000..00478276b6c929424245b9540189366b020172a3 GIT binary patch literal 3795 zcmeAS@N?(olHy`uVBq!ia0y~yUl5RScXGVsCl)HQk3>7nHGBI$R z5n*shSOzrQn3X|bh9*P90Ut&NmNYH~1p}aUjiX9N!(}uvjAoM2l3}zs9IYls>&DRr t!DvHiv~@VzY98$>jP{T4^cxSd^|f?V9|6c$A literal 0 HcmV?d00001 diff --git a/test/test_formats.sh b/test/test_formats.sh index 72af1ad4..bce44af1 100755 --- a/test/test_formats.sh +++ b/test/test_formats.sh @@ -7,6 +7,10 @@ . ./variables.sh +# poppler / pdfload reference image +poppler=$test_images/blankpage.pdf +poppler_ref=$test_images/blankpage.png + # the matlab image and reference image matlab=$test_images/sample.mat matlab_ref=$test_images/sample.png @@ -215,6 +219,10 @@ test_rad $rad test_raw $mono test_raw $image +if test_supported pdfload; then + test_loader $poppler_ref $poppler pdfload +fi + if test_supported matload; then test_loader $matlab_ref $matlab matlab fi