skip the unnecessary palette benign error before 1.6
authorTony Cook <tony@develop-help.com>
Fri, 27 Jun 2014 11:29:40 +0000 (21:29 +1000)
committerTony Cook <tony@develop-help.com>
Fri, 27 Jun 2014 11:29:40 +0000 (21:29 +1000)
since libpng didn't report it then

Changes
PNG/Changes
PNG/PNG.pm
PNG/t/10png.t

diff --git a/Changes b/Changes
index ef3ef4916c0c7d9ef26b6b9c656e25ff164a4b63..7a3aac67107cf624bcee155f25b10e9e16386e42 100644 (file)
--- a/Changes
+++ b/Changes
@@ -9,6 +9,10 @@ Imager release history.  Older releases can be found in Changes.old
  - fix SV type probing to work on perl before 5.12.
    https://rt.cpan.org/Ticket/Display.html?id=96761
 
+ - PNG: skip the benign error test before libpng 1.6.0, since the
+   error we're testing didn't exist before 1.6.0.
+   https://rt.cpan.org/Ticket/Display.html?id=94717 (continued)
+
 Imager 0.99 - 25 Jun 2014
 ===========
 
index 835b198ccf12dbfa59ac38045b3c2686f7d97ea5..7685d1fe2783c33a74f3a91f263c5b758aa32e27 100644 (file)
@@ -1,3 +1,9 @@
+Imager-File-PNG 0.91
+====================
+
+ - skip the benign tests before libpng 1.6.0 since older versions do
+   not treat an extranrous palette as any sort of error.
+
 Imager-File-PNG 0.90
 ====================
 
index 15da00fe4b6ea03b599da340327c8bd9928b393e..05670754b411b998e54b68a8a0b7113065e1b034 100644 (file)
@@ -4,7 +4,7 @@ use Imager;
 use vars qw($VERSION @ISA);
 
 BEGIN {
-  $VERSION = "0.90";
+  $VERSION = "0.91";
 
   require XSLoader;
   XSLoader::load('Imager::File::PNG', $VERSION);
index b9365e468f6864d85c501a9fde16a9db0b3f8e79..b1915075039cff26106e52c99393ca499853ed4e 100644 (file)
@@ -195,13 +195,18 @@ SKIP:
        "read bad crc with png_ignore_benign_errors");
   }
 
-  my $im = Imager->new;
-  ok($im->read(file => "testimg/bipalette.png", type => "png",
-              png_ignore_benign_errors => 1),
+ SKIP:
+  {
+    Imager::File::PNG::i_png_lib_version() >= 10600
+       or skip "unused palette not benign errored before 1.6.0", 2;
+    my $im = Imager->new;
+    ok($im->read(file => "testimg/bipalette.png", type => "png",
+                png_ignore_benign_errors => 1),
        "read grey image with palette with png_ignore_benign_errors");
-  ok(!$im->read(file => "testimg/bipalette.png", type => "png",
-              png_ignore_benign_errors => 0),
+    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