diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-05-14 16:20:58 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-05-14 18:02:15 -0700 |
commit | 5aa5976a712bc783b5e077abaacab0a62e5ca9eb (patch) | |
tree | 329741c1283a8ad8c95f557e49358bf8d32580d0 /platform/default/png_reader.cpp | |
parent | 2efaeb88167f3e69d160ebfbac36fbacf9e697cb (diff) | |
download | qtlocation-mapboxgl-5aa5976a712bc783b5e077abaacab0a62e5ca9eb.tar.gz |
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.
Diffstat (limited to 'platform/default/png_reader.cpp')
-rw-r--r-- | platform/default/png_reader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp index 91fe007bcf..4f8596a7b0 100644 --- a/platform/default/png_reader.cpp +++ b/platform/default/png_reader.cpp @@ -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_) { |