From 5aa5976a712bc783b5e077abaacab0a62e5ca9eb Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 14 May 2015 16:20:58 -0700 Subject: [PATCH] Speculative fix for PNG alpha/gamma handling The libpng documentation is hopelessly impenetrable and I have no idea what I'm doing, but this seems to fix the headless rendering failures. --- platform/default/png_reader.cpp | 2 +- test/suite | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp index 91fe007bc..4f8596a7b 100644 --- a/platform/default/png_reader.cpp +++ b/platform/default/png_reader.cpp @@ -157,7 +157,7 @@ void PngReader::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char * double gamma; if (png_get_gAMA(png_ptr, info_ptr, &gamma)) png_set_gamma(png_ptr, 2.2, gamma); - png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, 2.2); + png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, PNG_GAMMA_LINEAR); if (x0 == 0 && y0 == 0 && w >= width_ && h >= height_) { diff --git a/test/suite b/test/suite index 089df3bae..769c4c9c2 160000 --- a/test/suite +++ b/test/suite @@ -1 +1 @@ -Subproject commit 089df3baea65bd13c7cb0e9d34104ec35aa65c50 +Subproject commit 769c4c9c23cdb232d7c7dd657d69963ae951210a