782
|
1 |
--- qt-x11-free-3.3.5/src/kernel/qpngio.cpp.orig Fri Feb 10 14:45:53 2006
|
|
2 |
+++ qt-x11-free-3.3.5/src/kernel/qpngio.cpp Fri Feb 10 14:48:05 2006
|
|
3 |
@@ -110,10 +110,18 @@
|
|
4 |
static
|
|
5 |
void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float screen_gamma=0.0 )
|
|
6 |
{
|
|
7 |
- if ( screen_gamma != 0.0 && png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) {
|
|
8 |
+ if ( 0.0 == screen_gamma )
|
|
9 |
+ // PNG docs say this is a good guess for a PC monitor
|
|
10 |
+ // in a dark room
|
|
11 |
+ screen_gamma = 2.2;
|
|
12 |
+ if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) {
|
|
13 |
+ // the file has a gAMA attribute
|
|
14 |
double file_gamma;
|
|
15 |
- png_get_gAMA(png_ptr, info_ptr, &file_gamma);
|
|
16 |
- png_set_gamma( png_ptr, screen_gamma, file_gamma );
|
|
17 |
+ if ( png_get_gAMA(png_ptr, info_ptr, &file_gamma))
|
|
18 |
+ png_set_gamma( png_ptr, screen_gamma, file_gamma );
|
|
19 |
+ } else {
|
|
20 |
+ // no file gamma, use a reasonable default
|
|
21 |
+ png_set_gamma( png_ptr, screen_gamma, 0.45455 );
|
|
22 |
}
|
|
23 |
|
|
24 |
png_uint_32 width;
|