From 04402a9126a193ec36a65481216bcb3939f33043 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Sat, 26 Sep 2015 17:41:02 -0700 Subject: [PATCH] Fix (work round) rgb-to-gray issues in libpng 1.6 The previous attempts to ignore the errors in the code aren't quite enough to deal with the 'channel selection' encoding added to libpng 1.7; abort. pngvalid.c is changed to drop this encoding in prior versions. Signed-off-by: John Bowler --- contrib/libtests/pngvalid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 35ded08fe..814023591 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -10960,11 +10960,13 @@ static const color_encoding test_encodings[] = /*red: */ { 0.716500716779386, 0.258728243040113, 0.000000000000000 }, /*green:*/ { 0.101020574397477, 0.724682314948566, 0.051211818965388 }, /*blue: */ { 0.146774385252705, 0.016589442011321, 0.773892783545073} }, +#if PNG_LIBPNG_VER >= 10700 /* Fake encoding which selects just the green channel */ /*gamma:*/ { 1.45/2.2, /* the 'Mac' gamma */ /*red: */ { 0.716500716779386, 0.000000000000000, 0.000000000000000 }, /*green:*/ { 0.101020574397477, 1.000000000000000, 0.051211818965388 }, /*blue: */ { 0.146774385252705, 0.000000000000000, 0.773892783545073} }, +#endif }; /* signal handler