From b064624dd7bd6d8222e2b2a20f7e6b014b87a1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 18 Jun 2014 15:29:57 +0200 Subject: [PATCH] Adjusts tests to libpng-1.6.10 --- ...1.6.10-no-longer-considers-CRC-error.patch | 89 +++++++++++++++++++ perl-Imager.spec | 14 ++- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch diff --git a/Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch b/Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch new file mode 100644 index 0000000..25eb0be --- /dev/null +++ b/Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch @@ -0,0 +1,89 @@ +From 1f8952f5facccefdd10e4ab1f13ce3abac183216 Mon Sep 17 00:00:00 2001 +From: Tony Cook +Date: Fri, 13 Jun 2014 20:51:05 +1000 +Subject: [PATCH] RT #94717 libpng 1.6.10 no longer considers CRC errors benign +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +use a different badness for checking benign error support + +Petr Pisar: Ported to 0.98. + +Signed-off-by: Petr Písař +--- + MANIFEST | 1 + + PNG/t/10png.t | 22 ++++++++++++++++++---- + PNG/testimg/bipalette.png | Bin 0 -> 129 bytes + 3 files changed, 19 insertions(+), 4 deletions(-) + create mode 100644 PNG/testimg/bipalette.png + +diff --git a/MANIFEST b/MANIFEST +index 2723a3b..7bb8921 100644 +--- a/MANIFEST ++++ b/MANIFEST +@@ -240,6 +240,7 @@ PNG/t/00load.t + PNG/t/10png.t Test png support + PNG/testimg/badcrc.png + PNG/testimg/bilevel.png ++PNG/testimg/bipalette.png bi-level but with a palette + PNG/testimg/comment.png + PNG/testimg/cover.png + PNG/testimg/cover16.png +diff --git a/PNG/t/10png.t b/PNG/t/10png.t +index bc109d7..b9365e4 100644 +--- a/PNG/t/10png.t ++++ b/PNG/t/10png.t +@@ -10,7 +10,7 @@ my $debug_writes = 1; + + init_log("testout/t102png.log",1); + +-plan tests => 249; ++plan tests => 251; + + # this loads Imager::File::PNG too + ok($Imager::formats{"png"}, "must have png format"); +@@ -183,11 +183,25 @@ EOS + SKIP: + { # ignoring "benign" errors + $png_feat{"benign-errors"} +- or skip "libpng not configured for benign error support", 1; ++ or skip "libpng not configured for benign error support", 3; ++ ++ SKIP: ++ { ++ Imager::File::PNG::i_png_lib_version() < 10610 ++ or skip "1.6.10 and later treat CRC errors as non-benign", 1; ++ my $im = Imager->new; ++ ok($im->read(file => "testimg/badcrc.png", type => "png", ++ png_ignore_benign_errors => 1), ++ "read bad crc with png_ignore_benign_errors"); ++ } ++ + my $im = Imager->new; +- ok($im->read(file => "testimg/badcrc.png", type => "png", ++ ok($im->read(file => "testimg/bipalette.png", type => "png", + png_ignore_benign_errors => 1), +- "read bad crc with png_ignore_benign_errors"); ++ "read grey image with palette with png_ignore_benign_errors"); ++ ok(!$im->read(file => "testimg/bipalette.png", type => "png", ++ png_ignore_benign_errors => 0), ++ "read grey image with palette without png_ignore_benign_errors should fail"); + } + + { # write error reporting +diff --git a/PNG/testimg/bipalette.png b/PNG/testimg/bipalette.png +new file mode 100644 +index 0000000000000000000000000000000000000000..b105e44bb7ba2a61fa159b53b12751afa2b08803 +GIT binary patch +literal 129 +zcmeAS@N?(olHy`uVBq!ia0vp^Od!k%Bp9O38gv3Fg8-ipS0K&7!670dqNu27XlUr? +z=T}}{zF@(Ey?ghbJ9qBdwQKk8-FyE0`TO_pzkmP!|NsAeyACb|>f!NpaSY*@nOu;N +a!N9=i!f-G@-S7cWoWax8&t;ucLK6UHp)BbD + +literal 0 +HcmV?d00001 + +-- +1.9.3 + diff --git a/perl-Imager.spec b/perl-Imager.spec index dc92480..ebe88ea 100644 --- a/perl-Imager.spec +++ b/perl-Imager.spec @@ -1,11 +1,16 @@ Name: perl-Imager Version: 0.98 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Perl extension for Generating 24 bit Images License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/Imager/ Source0: http://www.cpan.org/authors/id/T/TO/TONYC/Imager-%{version}.tar.gz +# Adjusts tests to libpng-1.6.10, bug #1099392, CPAN RT#94717, in upstream +# after 0.98. +Patch0: Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch +# For Imager-0.98-RT-94717-libpng-1.6.10-no-longer-considers-CRC-error.patch +BuildRequires: git BuildRequires: perl(Affix::Infix2Postfix) BuildRequires: perl(ExtUtils::MakeMaker) @@ -46,6 +51,10 @@ Summary: perl-Imager's Test module %prep %setup -q -n Imager-%{version} +git init-db . +git add . +git commit -m 'original' +git am < '%PATCH0' # fix permissions find \( -executable -a -type f \) -exec chmod -x {} \; @@ -83,6 +92,9 @@ make test AUTOMATED_TESTING=1 %{_mandir}/man3/Imager::Test.3pm* %changelog +* Wed Jun 18 2014 Petr Pisar - 0.98-3 +- Adjusts tests to libpng-1.6.10 (bug #1099392) + * Sat Jun 07 2014 Fedora Release Engineering - 0.98-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild