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.
This commit is contained in:
John Firebaugh
2015-05-14 16:20:58 -07:00
parent 2efaeb8816
commit 5aa5976a71
2 changed files with 2 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ void PngReader<T>::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_)
{