[Pkg-kde-commits] rev 2104 - in trunk/packages/qt-x11-free/debian: . patches

Christopher Martin chrsmrtn at costa.debian.org
Fri Oct 21 18:50:45 UTC 2005


Author: chrsmrtn
Date: 2005-10-21 18:50:44 +0000 (Fri, 21 Oct 2005)
New Revision: 2104

Added:
   trunk/packages/qt-x11-free/debian/patches/28_png-gamma-fix.dpatch
Removed:
   trunk/packages/qt-x11-free/debian/patches/28_qtc_png-gamma-fix.dpatch
Modified:
   trunk/packages/qt-x11-free/debian/changelog
   trunk/packages/qt-x11-free/debian/patches/00list
Log:
New gamma patch. Doesn't crash anything, so let's try it out...


Modified: trunk/packages/qt-x11-free/debian/changelog
===================================================================
--- trunk/packages/qt-x11-free/debian/changelog	2005-10-21 18:37:39 UTC (rev 2103)
+++ trunk/packages/qt-x11-free/debian/changelog	2005-10-21 18:50:44 UTC (rev 2104)
@@ -2,6 +2,9 @@
 
   +++ Changes by Christopher Martin:
 
+  * Replace qt-copy's gamma patch with an improved patch from Charles Samuels.
+    (Closes: #333542)
+
   * Build the InterBase plugin on amd64, now that firebird2 builds there.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Date

Modified: trunk/packages/qt-x11-free/debian/patches/00list
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/00list	2005-10-21 18:37:39 UTC (rev 2103)
+++ trunk/packages/qt-x11-free/debian/patches/00list	2005-10-21 18:50:44 UTC (rev 2104)
@@ -18,7 +18,7 @@
 25_qtc_qpixmap_mitshm
 26_qtc_qpixmap_constants
 27_qtc_qscrollview-windowactivate-fix
-28_qtc_png-gamma-fix
+28_png-gamma-fix
 29_qtc_fix_rotated_randr
 30_qtc_qtoolbar_77047
 31_gcc4_buildkey

Added: trunk/packages/qt-x11-free/debian/patches/28_png-gamma-fix.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/28_png-gamma-fix.dpatch	2005-10-21 18:37:39 UTC (rev 2103)
+++ trunk/packages/qt-x11-free/debian/patches/28_png-gamma-fix.dpatch	2005-10-21 18:50:44 UTC (rev 2104)
@@ -0,0 +1,72 @@
+#! /bin/sh -e
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qpngio.cpp
++++ qt.patched/src/kernel/qpngio.cpp
+@@ -110,12 +110,20 @@
+ static
+ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float screen_gamma=0.0 )
+ {
+-    if ( screen_gamma != 0.0 && png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) {
+-	double file_gamma;
+-	png_get_gAMA(png_ptr, info_ptr, &file_gamma);
+-	png_set_gamma( png_ptr, screen_gamma, file_gamma );
+-    }
+-
++    if ( screen_gamma  < 0.0 )
++	// PNG docs say this is a good guess for a PC monitor
++        // in a dark room
++	screen_gamma = 2.2;
++    if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) {
++	// the file has a gAMA attribute
++ 	double file_gamma;
++	if ( png_get_gAMA(png_ptr, info_ptr, &file_gamma))
++	    png_set_gamma( png_ptr, screen_gamma, file_gamma );
++    } else {
++	// no file gamma, use a reasonable default
++	png_set_gamma( png_ptr, screen_gamma, 0.0 ); 
++     }
++    
+     png_uint_32 width;
+     png_uint_32 height;
+     int bit_depth;
+--- qt.orig/src/kernel/qimage.cpp
++++ qt.patched/src/kernel/qimage.cpp
+@@ -3783,7 +3783,7 @@
+     d = new QImageIOData();
+     d->parameters = 0;
+     d->quality = -1; // default quality of the current format
+-    d->gamma=0.0f;
++    d->gamma=-1.0f;
+     iostat = 0;
+     iodev  = 0;
+ }
+@@ -4187,7 +4187,9 @@
+     modify the image. Setting to 0.0 will disable gamma correction
+     (i.e. any specification in the file will be ignored).
+ 
+-    The default value is 0.0.
++    Setting to a negative number will use reasonable defaults
++
++    The default value is -1.0.
+ 
+     \sa gamma()
+ */

Deleted: trunk/packages/qt-x11-free/debian/patches/28_qtc_png-gamma-fix.dpatch




More information about the pkg-kde-commits mailing list