[colord/f19] Backport a few patches from color-1-0 to fix calibration for more people

Richard Hughes rhughes at fedoraproject.org
Wed Dec 11 12:00:07 UTC 2013


commit c794e8045d8e2d7f4f4889376da51a0d53daab4d
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Dec 11 12:00:03 2013 +0000

    Backport a few patches from color-1-0 to fix calibration for more people

 calibration-fixes.patch |   79 +++++++++++++++++++++++++++++++++++++++++++++++
 colord.spec             |   10 +++++-
 2 files changed, 88 insertions(+), 1 deletions(-)
---
diff --git a/calibration-fixes.patch b/calibration-fixes.patch
new file mode 100644
index 0000000..6cfc050
--- /dev/null
+++ b/calibration-fixes.patch
@@ -0,0 +1,79 @@
+diff --git a/contrib/session-helper/cd-main.c b/contrib/session-helper/cd-main.c
+index c5e0a50..fd3cfb7 100644
+--- a/contrib/session-helper/cd-main.c
++++ b/contrib/session-helper/cd-main.c
+@@ -1488,6 +1488,7 @@ cd_main_start_calibration (CdMainPrivate *priv,
+ 			cd_main_emit_interaction_required (priv,
+ 							   CD_SESSION_INTERACTION_MOVE_TO_CALIBRATION);
+ 			g_error_free (error_local);
++			ret = TRUE;
+ 		} else if (g_error_matches (error_local,
+ 					    CD_SENSOR_ERROR,
+ 					    CD_SENSOR_ERROR_REQUIRED_POSITION_SURFACE)) {
+@@ -1495,6 +1496,7 @@ cd_main_start_calibration (CdMainPrivate *priv,
+ 			cd_main_emit_interaction_required (priv,
+ 							   CD_SESSION_INTERACTION_MOVE_TO_SURFACE);
+ 			g_error_free (error_local);
++			ret = TRUE;
+ 		} else {
+ 			g_propagate_error (error, error_local);
+ 			goto out;
+@@ -1562,6 +1564,10 @@ cd_main_start_calibration_cb (gpointer user_data)
+ 		goto out;
+ 	}
+ 
++	/* still waiting */
++	if (priv->status == CD_SESSION_STATUS_WAITING_FOR_INTERACTION)
++		goto out;
++
+ 	/* success */
+ 	cd_main_emit_finished (priv, CD_SESSION_ERROR_NONE, NULL);
+ 	g_timeout_add (200, cd_main_finished_quit_cb, priv);
+@@ -1975,6 +1981,7 @@ cd_main_daemon_method_call (GDBusConnection *connection,
+ 		}
+ 
+ 		/* actually start the process now */
++		priv->status = CD_SESSION_STATUS_IDLE;
+ 		g_idle_add (cd_main_start_calibration_cb, priv);
+ 		g_dbus_method_invocation_return_value (invocation, NULL);
+ 		goto out;
+diff --git a/lib/colord/cd-color.c b/lib/colord/cd-color.c
+index 35f9ee1..72efdc9 100644
+--- a/lib/colord/cd-color.c
++++ b/lib/colord/cd-color.c
+@@ -892,6 +892,8 @@ cd_color_rgb_array_is_monotonic (const GPtrArray *array)
+ 	CdColorRGB *rgb;
+ 	guint i;
+ 
++	g_return_val_if_fail (array != NULL, FALSE);
++
+ 	/* check if monotonic */
+ 	cd_color_rgb_set (&last_rgb, 0.0, 0.0, 0.0);
+ 	for (i = 0; i < array->len; i++) {
+@@ -947,6 +949,9 @@ cd_color_rgb_array_interpolate (const GPtrArray *array, guint new_length)
+ 	guint j;
+ 	guint m;
+ 
++	g_return_val_if_fail (array != NULL, NULL);
++	g_return_val_if_fail (new_length > 0, NULL);
++
+ 	/* check if monotonic */
+ 	ret = cd_color_rgb_array_is_monotonic (array);
+ 	if (!ret)
+@@ -1023,6 +1028,16 @@ cd_color_get_blackbody_rgb (guint temp, CdColorRGB *result)
+ 	gdouble alpha;
+ 	gint temp_index;
+ 
++	/* check lower bound */
++	if (temp < 1000) {
++		temp = 1000;
++	}
++
++	/* check upper bound */
++	if (temp > 10000) {
++		temp = 10000;
++	}
++
+ 	/* bilinear interpolate the blackbody data */
+ 	alpha = (temp % 100) / 100.0;
+ 	temp_index = (temp - 1000) / 100;
diff --git a/colord.spec b/colord.spec
index 20e89e4..88ac9c3 100644
--- a/colord.spec
+++ b/colord.spec
@@ -19,11 +19,14 @@
 Summary:   Color daemon
 Name:      colord
 Version:   1.0.5
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   GPLv2+ and LGPLv2+
 URL:       http://www.freedesktop.org/software/colord/
 Source0:   http://www.freedesktop.org/software/colord/releases/%{name}-%{version}.tar.xz
 
+# Already upstream
+Patch0:    calibration-fixes.patch
+
 BuildRequires: dbus-devel
 BuildRequires: docbook-utils
 BuildRequires: gettext
@@ -107,6 +110,7 @@ This may be useful for CMYK soft-proofing or for extra device support.
 
 %prep
 %setup -q
+%patch0 -p1 -b calibration-fixes
 
 %build
 # Set ~2 GiB limit so that colprof is forced to work in chunks when
@@ -272,6 +276,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/gtk-doc/html/colord/*
 
 %changelog
+* Wed Dec 11 2013 Richard Hughes <richard at hughsie.com> 1.0.5-2
+- Backport a few patches from color-1-0 to fix calibration for more people.
+- Resolves: #973792
+
 * Wed Dec 04 2013 Richard Hughes <richard at hughsie.com> 1.0.5-1
 - New upstream version
 - Detect at runtime if the lcms2 function MemoryWrite is faulty


More information about the scm-commits mailing list