version 2.8.8

This commit is contained in:
Nils Philippsen 2013-11-04 13:48:06 +01:00
parent 3d2f3e1d73
commit b83f435145
5 changed files with 12 additions and 996 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@ gimp-2.6.10-1-autoreconf.patch.bz2
/gimp-2.8.4-5-autofoo.patch.bz2
/gimp-2.8.6.tar.bz2
/gimp-2.8.6-4-autoconf.patch.bz2
/gimp-2.8.8.tar.bz2

View File

@ -1,172 +0,0 @@
From 9e143c6a91ba239eca11b5394f963e0b8bb291b8 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Mon, 8 Jul 2013 11:55:17 +0200
Subject: [PATCH] patch: exit-while-loading
Squashed commit of the following:
commit 2dd51be1ce18b11a207efc90e3e8e8c07ba6f7d7
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date: Thu Jul 4 21:36:40 2013 +0200
Bug 629941 - GIMP doesn't exit properly when quitting while loading images
GIMP's "exit" signal was emitted before the handler was connected.
Don't start loading command line images or batch processing before
app_exit_after_callback() is connected. Make sure we don't use
dangling main loop pointers or try to stop a non-running main loop.
(cherry picked from commit 09682d62ae675125e91d537c3ccbdd4571a0b28e)
commit bc44719702a5cdcc4944a9a5e1f310c1740c6308
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date: Thu Jul 4 21:05:25 2013 +0200
app: file_open_from_command_line(): don't access a dangling display pointer
Happens if GIMP is quit while the image is being loaded.
(cherry picked from commit 6c62eb2238d2167ebe20ee02ad32ef733db475b1)
---
app/app.c | 53 +++++++++++++++++++++++++++++++---------------------
app/file/file-open.c | 7 ++++++-
2 files changed, 38 insertions(+), 22 deletions(-)
diff --git a/app/app.c b/app/app.c
index e6b7407..dbbc1b3 100644
--- a/app/app.c
+++ b/app/app.c
@@ -72,12 +72,12 @@
/* local prototypes */
-static void app_init_update_noop (const gchar *text1,
- const gchar *text2,
- gdouble percentage);
-static gboolean app_exit_after_callback (Gimp *gimp,
- gboolean kill_it,
- GMainLoop *loop);
+static void app_init_update_noop (const gchar *text1,
+ const gchar *text2,
+ gdouble percentage);
+static gboolean app_exit_after_callback (Gimp *gimp,
+ gboolean kill_it,
+ GMainLoop **loop);
/* public functions */
@@ -149,6 +149,7 @@ app_run (const gchar *full_prog_name,
Gimp *gimp;
GimpBaseConfig *config;
GMainLoop *loop;
+ GMainLoop *run_loop;
gboolean swap_is_ok;
/* Create an instance of the "Gimp" object which is the root of the
@@ -234,6 +235,12 @@ app_run (const gchar *full_prog_name,
*/
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
+ loop = run_loop = g_main_loop_new (NULL, FALSE);
+
+ g_signal_connect_after (gimp, "exit",
+ G_CALLBACK (app_exit_after_callback),
+ &run_loop);
+
/* Load the images given on the command-line.
*/
if (filenames)
@@ -241,20 +248,21 @@ app_run (const gchar *full_prog_name,
gint i;
for (i = 0; filenames[i] != NULL; i++)
- file_open_from_command_line (gimp, filenames[i], as_new);
+ {
+ if (run_loop)
+ file_open_from_command_line (gimp, filenames[i], as_new);
+ }
}
- batch_run (gimp, batch_interpreter, batch_commands);
-
- loop = g_main_loop_new (NULL, FALSE);
+ if (run_loop)
+ batch_run (gimp, batch_interpreter, batch_commands);
- g_signal_connect_after (gimp, "exit",
- G_CALLBACK (app_exit_after_callback),
- loop);
-
- gimp_threads_leave (gimp);
- g_main_loop_run (loop);
- gimp_threads_enter (gimp);
+ if (run_loop)
+ {
+ gimp_threads_leave (gimp);
+ g_main_loop_run (loop);
+ gimp_threads_enter (gimp);
+ }
g_main_loop_unref (loop);
@@ -279,9 +287,9 @@ app_init_update_noop (const gchar *text1,
}
static gboolean
-app_exit_after_callback (Gimp *gimp,
- gboolean kill_it,
- GMainLoop *loop)
+app_exit_after_callback (Gimp *gimp,
+ gboolean kill_it,
+ GMainLoop **loop)
{
if (gimp->be_verbose)
g_print ("EXIT: %s\n", G_STRFUNC);
@@ -297,7 +305,10 @@ app_exit_after_callback (Gimp *gimp,
#ifdef GIMP_UNSTABLE
- g_main_loop_quit (loop);
+ if (g_main_loop_is_running (*loop))
+ g_main_loop_quit (*loop);
+
+ *loop = NULL;
#else
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 8abb19e..fdf73f3 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -562,6 +562,8 @@ file_open_from_command_line (Gimp *gimp,
GimpObject *display = gimp_get_empty_display (gimp);
GimpPDBStatusType status;
+ g_object_add_weak_pointer (G_OBJECT (display), (gpointer) &display);
+
image = file_open_with_display (gimp,
gimp_get_user_context (gimp),
GIMP_PROGRESS (display),
@@ -575,7 +577,7 @@ file_open_from_command_line (Gimp *gimp,
g_object_set_data_full (G_OBJECT (gimp), GIMP_FILE_OPEN_LAST_URI_KEY,
uri, (GDestroyNotify) g_free);
}
- else if (status != GIMP_PDB_CANCEL)
+ else if (status != GIMP_PDB_CANCEL && display)
{
gchar *filename = file_utils_uri_display_name (uri);
@@ -587,6 +589,9 @@ file_open_from_command_line (Gimp *gimp,
g_free (filename);
g_free (uri);
}
+
+ if (display)
+ g_object_remove_weak_pointer (G_OBJECT (display), (gpointer) &display);
}
else
{
--
1.8.3.1

View File

@ -1,801 +0,0 @@
From 8cff4692740cb6abd1eb87ba7d88e86aaab32099 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Thu, 19 Sep 2013 17:45:48 +0200
Subject: [PATCH] patch: lcms2
Squashed commit of the following:
commit c8e5735272fc436174b9969a41f3b16722f381f7
Author: Nils Philippsen <nils@redhat.com>
Date: Thu Sep 19 17:38:46 2013 +0200
lcms: pretty code even better if syntactically correct
Thanks to Jehan for spotting this.
commit fb40ab72c3e54be46df64916cf6f80cbd6924fbd
Author: Michael Natterer <mitch@gimp.org>
Date: Tue Sep 25 20:56:54 2012 +0200
app: don't crash when a color profile has no information
(cherry picked from commit 9d42df5fa2d2ce598c5896cb0f023a5db65c7f2a)
commit 0b3eaef82120c3ac764e50c0d5e78be766d4ebf5
Author: Nils Philippsen <nils@redhat.com>
Date: Tue Sep 17 16:43:11 2013 +0200
Backport lcms 2.x support from master, making it optional.
In order to retain support for lcms 1.x, this merges the lcms2-specific
code as a configurable alternative.
The user can specify which version to use by specifying
"--with-lcms=lcms1" or "--with-lcms=lcms2" when running configure. If no
version is specified explicitly, version 1.x will be preferred if both
versions are available. This ensures that GIMP is built with the same
lcms version as an older version, if the same configure switches are
used and the same libraries are available.
This builds on the following commits from the master branch:
commit c59ab4d817730430b4b037de07abd28281f1dcf7
Author: Massimo Valentini <mvalentini@src.gnome.org>
AuthorDate: Tue Sep 4 17:53:06 2012 +0200
lcms: oversight
commit 8bbfc9e5cf4728b9cafc4edf32ab52c32375f9b7
Author: Michael Natterer <mitch@gimp.org>
AuthorDate: Mon Sep 3 20:03:53 2012 +0200
Bug 675558 - switch from lcms-1 to lcms-2
Applied modified patch from Hartmut Kuhse which ports to lcms-2.
commit dea42de6c76783ef1bab8f7e4910e26fff75312f
Author: Nils Philippsen <nils@redhat.com>
Date: Wed Sep 18 13:46:13 2013 +0200
include missing header
---
app/widgets/gimpprofilechooserdialog.c | 4 +-
configure.ac | 49 ++++++++++++---
modules/color-selector-cmyk-lcms.c | 64 ++++++++++++++++++-
modules/display-filter-lcms.c | 109 ++++++++++++++++++++++++++++++++-
modules/display-filter-proof.c | 45 +++++++++++++-
plug-ins/common/lcms.c | 96 ++++++++++++++++++++++++++---
plug-ins/file-jpeg/jpeg-load.c | 19 +++++-
7 files changed, 364 insertions(+), 22 deletions(-)
diff --git a/app/widgets/gimpprofilechooserdialog.c b/app/widgets/gimpprofilechooserdialog.c
index 79e408d..358dee5 100644
--- a/app/widgets/gimpprofilechooserdialog.c
+++ b/app/widgets/gimpprofilechooserdialog.c
@@ -332,7 +332,7 @@ gimp_profile_view_query (GimpProfileChooserDialog *dialog)
&name, &desc, &info,
NULL))
{
- gsize info_len = strlen (info);
+ gsize info_len = info ? strlen (info) : 0;
gsize name_len = strlen (filename);
/* lcms tends to adds the filename at the end of the info string.
@@ -344,7 +344,7 @@ gimp_profile_view_query (GimpProfileChooserDialog *dialog)
info_len -= name_len;
}
- gtk_text_buffer_set_text (dialog->buffer, info, info_len);
+ gtk_text_buffer_set_text (dialog->buffer, info ? info : "", info_len);
if (desc)
{
diff --git a/configure.ac b/configure.ac
index 888a120..1740a68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,8 @@ m4_define([libcurl_required_version], [7.15.1])
m4_define([dbus_glib_required_version], [0.70])
m4_define([libgudev_required_version], [167])
m4_define([exif_required_version], [0.6.15])
-m4_define([lcms_required_version], [1.16])
+m4_define([lcms1_required_version], [1.16])
+m4_define([lcms2_required_version], [2.2])
m4_define([libpng_required_version], [1.2.37])
@@ -1539,19 +1540,51 @@ AC_SUBST(JP2_LIBS)
# Check for lcms
################
-AC_ARG_WITH(lcms, [ --without-lcms build without lcms support])
+AC_ARG_WITH(lcms, [ --with-lcms build with lcms support (check, lcms1, lcms2)],
+ [],
+ [with_lcms=check])
have_lcms="no (lcms support disabled)"
if test "x$with_lcms" != xno; then
- have_lcms=yes
- PKG_CHECK_MODULES(LCMS, lcms >= lcms_required_version,
- AC_DEFINE(HAVE_LCMS, 1, [Define to 1 if lcms is available])
- LCMS='lcms$(EXEEXT)',
- have_lcms="no (lcms not found or unusable)")
+ if test "x$with_lcms" == x1 || \
+ test "x$with_lcms" == xlcms1 || \
+ test "x$with_lcms" == xcheck; then
+ PKG_CHECK_MODULES(LCMS1, lcms >= lcms1_required_version,
+ [have_lcms="yes (lcms1)"
+ AC_DEFINE(HAVE_LCMS, 1, [Define to 1 if lcms is available])
+ AC_DEFINE(HAVE_LCMS1, 1, [Define to 1 if lcms1 is available])
+ LCMS_CFLAGS="$LCMS1_CFLAGS"
+ LCMS_LIBS="$LCMS1_LIBS"
+ LCMS='lcms$(EXEEXT)'],
+ [have_lcms="no (lcms1 not found)"])
+ fi
+
+ if test "x$have_lcms" != "xyes (lcms1)"; then
+ if test "x$with_lcms" == x2 || \
+ test "x$with_lcms" == xlcms2 || \
+ test "x$with_lcms" == xcheck; then
+ PKG_CHECK_MODULES(LCMS2, lcms2 >= lcms2_required_version,
+ [have_lcms="yes (lcms2)"
+ AC_DEFINE(HAVE_LCMS, 1, [Define to 1 if lcms is available])
+ AC_DEFINE(HAVE_LCMS2, 1, [Define to 1 if lcms2 is available])
+ LCMS_CFLAGS="$LCMS2_CFLAGS"
+ LCMS_LIBS="$LCMS2_LIBS"
+ LCMS='lcms$(EXEEXT)'],
+ [if test "x$with_lcms" == xcheck; then
+ have_lcms="no (lcms not found)"
+ else
+ have_lcms="no (lcms2 not found)"
+ fi])
+ fi
+ fi
fi
+AC_SUBST(LCMS_CFLAGS)
+AC_SUBST(LCMS_LIBS)
AC_SUBST(LCMS)
-AM_CONDITIONAL(HAVE_LCMS, test "x$have_lcms" = xyes)
+AM_CONDITIONAL(HAVE_LCMS,
+ [test "x$have_lcms" = "xyes (lcms1)" || \
+ test "x$have_lcms" == "xyes (lcms2)"])
######################
diff --git a/modules/color-selector-cmyk-lcms.c b/modules/color-selector-cmyk-lcms.c
index 0d5d20f..c668c3e 100644
--- a/modules/color-selector-cmyk-lcms.c
+++ b/modules/color-selector-cmyk-lcms.c
@@ -19,7 +19,12 @@
#include <glib.h> /* lcms.h uses the "inline" keyword */
+#ifdef HAVE_LCMS1
#include <lcms.h>
+typedef DWORD cmsUInt32Number;
+#else
+#include <lcms2.h>
+#endif
#include <gtk/gtk.h>
@@ -152,7 +157,9 @@ colorsel_cmyk_class_init (ColorselCmykClass *klass)
selector_class->set_color = colorsel_cmyk_set_color;
selector_class->set_config = colorsel_cmyk_set_config;
+#ifdef HAVE_LCMS1
cmsErrorAction (LCMS_ERROR_IGNORE);
+#endif
}
static void
@@ -391,10 +398,16 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
{
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (module);
GimpColorConfig *config = module->config;
- DWORD flags = 0;
+ cmsUInt32Number flags = 0;
+#ifdef HAVE_LCMS2
+ cmsUInt32Number descSize = 0;
+#endif
cmsHPROFILE rgb_profile;
cmsHPROFILE cmyk_profile;
- const gchar *name;
+#ifdef HAVE_LCMS2
+ gchar *descData;
+#endif
+ const gchar *name = NULL;
gchar *text;
if (module->rgb2cmyk)
@@ -419,13 +432,55 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
! (cmyk_profile = cmsOpenProfileFromFile (config->cmyk_profile, "r")))
goto out;
+#ifdef HAVE_LCMS1
name = cmsTakeProductDesc (cmyk_profile);
+#else
+ descSize = cmsGetProfileInfoASCII (cmyk_profile, cmsInfoDescription,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (cmyk_profile, cmsInfoDescription,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ {
+ name = descData;
+ }
+ else
+ {
+ g_free (descData);
+ descData = NULL;
+ }
+ }
+#endif
+
if (name && ! g_utf8_validate (name, -1, NULL))
name = _("(invalid UTF-8 string)");
if (! name)
{
+#ifdef HAVE_LCMS1
name = cmsTakeProductName (cmyk_profile);
+#else
+ descSize = cmsGetProfileInfoASCII (cmyk_profile, cmsInfoModel,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (cmyk_profile, cmsInfoModel,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ {
+ name = descData;
+ }
+ else
+ {
+ g_free (descData);
+ descData = NULL;
+ }
+ }
+#endif
+
if (name && ! g_utf8_validate (name, -1, NULL))
name = _("(invalid UTF-8 string)");
}
@@ -435,6 +490,11 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
gimp_help_set_help_data (module->name_label, text, NULL);
g_free (text);
+#ifdef HAVE_LCMS2
+ if (descData)
+ g_free (descData);
+#endif
+
rgb_profile = color_config_get_rgb_profile (config);
if (config->display_intent ==
diff --git a/modules/display-filter-lcms.c b/modules/display-filter-lcms.c
index 30c5857..e3052d7 100644
--- a/modules/display-filter-lcms.c
+++ b/modules/display-filter-lcms.c
@@ -19,13 +19,20 @@
#include <glib.h> /* lcms.h uses the "inline" keyword */
+#include <string.h>
+
#ifdef G_OS_WIN32
#define STRICT
#include <windows.h>
#define LCMS_WIN_TYPES_ALREADY_DEFINED
#endif
+#ifdef HAVE_LCMS1
#include <lcms.h>
+typedef DWORD cmsUInt32Number;
+#else
+#include <lcms2.h>
+#endif
#include <gtk/gtk.h>
@@ -134,7 +141,9 @@ cdisplay_lcms_class_init (CdisplayLcmsClass *klass)
display_class->convert_surface = cdisplay_lcms_convert_surface;
display_class->changed = cdisplay_lcms_changed;
+#ifdef HAVE_LCMS1
cmsErrorAction (LCMS_ERROR_IGNORE);
+#endif
}
static void
@@ -162,28 +171,101 @@ cdisplay_lcms_finalize (GObject *object)
G_OBJECT_CLASS (cdisplay_lcms_parent_class)->finalize (object);
}
+#ifdef HAVE_LCMS1
static void
cdisplay_lcms_profile_get_info (cmsHPROFILE profile,
const gchar **name,
const gchar **info)
+#else
+static void
+cdisplay_lcms_profile_get_info (cmsHPROFILE profile,
+ gchar **name,
+ gchar **info)
+#endif
{
if (profile)
{
+#ifdef HAVE_LCMS1
*name = cmsTakeProductDesc (profile);
+#else
+ cmsUInt32Number descSize;
+ gchar *descData;
+
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoDescription,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoDescription,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ *name = descData;
+ else
+ g_free (descData);
+ }
+#endif
if (! *name)
+#ifdef HAVE_LCMS1
*name = cmsTakeProductName (profile);
+#else
+ {
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII(profile, cmsInfoModel,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ *name = descData;
+ else
+ g_free (descData);
+ }
+ }
+#endif
+#ifdef HAVE_LCMS1
if (*name && ! g_utf8_validate (*name, -1, NULL))
*name = _("(invalid UTF-8 string)");
*info = cmsTakeProductInfo (profile);
if (*name && ! g_utf8_validate (*info, -1, NULL))
*info = NULL;
+#else
+ if (*name && ! g_utf8_validate (*name, -1, NULL))
+ {
+ g_free (*name);
+ *name = g_strdup (_("(invalid UTF-8 string)"));
+ }
+
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoManufacturer,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoManufacturer,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ *info = descData;
+ else
+ g_free (descData);
+ }
+
+ if (*info && ! g_utf8_validate (*info, -1, NULL))
+ {
+ g_free (*info);
+ *info = NULL;
+ }
+#endif
}
else
{
+#ifdef HAVE_LCMS1
*name = _("None");
+#else
+ *name = g_strdup (_("None"));
+#endif
*info = NULL;
}
}
@@ -313,7 +395,10 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
cmsHPROFILE src_profile = NULL;
cmsHPROFILE dest_profile = NULL;
cmsHPROFILE proof_profile = NULL;
- DWORD flags = 0;
+ cmsUInt32Number flags = 0;
+#ifdef HAVE_LCMS2
+ cmsUInt16Number alarmCodes[cmsMAXCHANNELS] = { 0 };
+#endif
if (lcms->transform)
{
@@ -363,7 +448,15 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
gimp_rgb_get_uchar (&config->out_of_gamut_color, &r, &g, &b);
+#ifdef HAVE_LCMS1
cmsSetAlarmCodes (r, g, b);
+#else
+ alarmCodes[0] = (cmsUInt16Number) r;
+ alarmCodes[1] = (cmsUInt16Number) g;
+ alarmCodes[2] = (cmsUInt16Number) b;
+
+ cmsSetAlarmCodes (alarmCodes);
+#endif
}
lcms->transform = cmsCreateProofingTransform (src_profile, TYPE_ARGB_8,
@@ -398,7 +491,11 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
static gboolean
cdisplay_lcms_profile_is_rgb (cmsHPROFILE profile)
{
+#ifdef HAVE_LCMS1
return (cmsGetColorSpace (profile) == icSigRgbData);
+#else
+ return (cmsGetColorSpace (profile) == cmsSigRgbData);
+#endif
}
static cmsHPROFILE
@@ -619,8 +716,13 @@ cdisplay_lcms_update_profile_label (CdisplayLcms *lcms,
{
GtkWidget *label;
cmsHPROFILE profile = NULL;
+#ifdef HAVE_LCMS1
const gchar *text;
const gchar *tooltip;
+#else
+ gchar *text = NULL;
+ gchar *tooltip = NULL;
+#endif
label = g_object_get_data (G_OBJECT (lcms), name);
@@ -649,6 +751,11 @@ cdisplay_lcms_update_profile_label (CdisplayLcms *lcms,
gtk_label_set_text (GTK_LABEL (label), text);
gimp_help_set_help_data (label, tooltip, NULL);
+#ifdef HAVE_LCMS2
+ g_free (text);
+ g_free (tooltip);
+#endif
+
if (profile)
cmsCloseProfile (profile);
}
diff --git a/modules/display-filter-proof.c b/modules/display-filter-proof.c
index 41967f5..5178395 100644
--- a/modules/display-filter-proof.c
+++ b/modules/display-filter-proof.c
@@ -19,7 +19,12 @@
#include <glib.h> /* lcms.h uses the "inline" keyword */
+#ifdef HAVE_LCMS1
#include <lcms.h>
+typedef DWORD cmsUInt32Number;
+#else
+#include <lcms2.h>
+#endif
#include <gtk/gtk.h>
@@ -146,7 +151,9 @@ cdisplay_proof_class_init (CdisplayProofClass *klass)
display_class->configure = cdisplay_proof_configure;
display_class->changed = cdisplay_proof_changed;
+#ifdef HAVE_LCMS1
cmsErrorAction (LCMS_ERROR_IGNORE);
+#endif
}
static void
@@ -298,9 +305,45 @@ cdisplay_proof_combo_box_set_active (GimpColorProfileComboBox *combo,
if (profile)
{
+#ifdef HAVE_LCMS1
label = gimp_any_to_utf8 (cmsTakeProductDesc (profile), -1, NULL);
+#else
+ cmsUInt32Number descSize;
+ gchar *descData;
+
+ descSize = cmsGetProfileInfoASCII(profile, cmsInfoDescription,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoDescription,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ label = gimp_any_to_utf8 (descData, -1, NULL);
+
+ g_free (descData);
+ }
+#endif
+
if (! label)
+#ifdef HAVE_LCMS1
label = gimp_any_to_utf8 (cmsTakeProductName (profile), -1, NULL);
+#else
+ {
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ label = gimp_any_to_utf8 (descData, -1, NULL);
+
+ g_free (descData);
+ }
+ }
+#endif
cmsCloseProfile (profile);
}
@@ -465,7 +508,7 @@ cdisplay_proof_changed (GimpColorDisplay *display)
if (proofProfile)
{
- DWORD flags = cmsFLAGS_SOFTPROOFING;
+ cmsUInt32Number flags = cmsFLAGS_SOFTPROOFING;
if (proof->bpc)
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index cb9ff57..cbbc53e 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -24,7 +24,12 @@
#include <glib.h> /* lcms.h uses the "inline" keyword */
+#ifdef HAVE_LCMS1
#include <lcms.h>
+typedef DWORD cmsUInt32Number;
+#else
+#include <lcms2.h>
+#endif
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
@@ -428,7 +433,9 @@ run (const gchar *name,
}
}
+#ifdef HAVE_LCMS1
cmsErrorAction (LCMS_ERROR_SHOW);
+#endif
switch (proc)
{
@@ -459,7 +466,9 @@ run (const gchar *name,
gchar *desc = NULL;
gchar *info = NULL;
+#ifdef HAVE_LCMS1
cmsErrorAction (LCMS_ERROR_IGNORE);
+#endif
if (proc == PROC_INFO)
status = lcms_icc_info (config, image, &name, &desc, &info);
@@ -496,25 +505,92 @@ run (const gchar *name,
static gchar *
lcms_icc_profile_get_name (cmsHPROFILE profile)
{
+#ifdef HAVE_LCMS1
return gimp_any_to_utf8 (cmsTakeProductName (profile), -1, NULL);
+#else
+ cmsUInt32Number descSize;
+ gchar *descData;
+ gchar *name = NULL;
+
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ name = gimp_any_to_utf8 (descData, -1, NULL);
+
+ g_free (descData);
+ }
+
+ return name;
+#endif
}
static gchar *
lcms_icc_profile_get_desc (cmsHPROFILE profile)
{
+#ifdef HAVE_LCMS1
return gimp_any_to_utf8 (cmsTakeProductDesc (profile), -1, NULL);
+#else
+ cmsUInt32Number descSize;
+ gchar *descData;
+ gchar *desc = NULL;
+
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoDescription,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoDescription,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ desc = gimp_any_to_utf8 (descData, -1, NULL);
+
+ g_free (descData);
+ }
+
+ return desc;
+#endif
}
static gchar *
lcms_icc_profile_get_info (cmsHPROFILE profile)
{
+#ifdef HAVE_LCMS1
return gimp_any_to_utf8 (cmsTakeProductInfo (profile), -1, NULL);
+#else
+ cmsUInt32Number descSize;
+ gchar *descData;
+ gchar *info = NULL;
+
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", NULL, 0);
+ if (descSize > 0)
+ {
+ descData = g_new (gchar, descSize + 1);
+ descSize = cmsGetProfileInfoASCII (profile, cmsInfoModel,
+ "en", "US", descData, descSize);
+ if (descSize > 0)
+ info = gimp_any_to_utf8 (descData, -1, NULL);
+
+ g_free (descData);
+ }
+
+ return info;
+#endif
}
static gboolean
lcms_icc_profile_is_rgb (cmsHPROFILE profile)
{
+#ifdef HAVE_LCMS1
return (cmsGetColorSpace (profile) == icSigRgbData);
+#else
+ return (cmsGetColorSpace (profile) == cmsSigRgbData);
+#endif
}
static GimpPDBStatusType
@@ -737,9 +813,15 @@ lcms_calculate_checksum (const gchar *data,
{
GChecksum *md5 = g_checksum_new (G_CHECKSUM_MD5);
+#ifdef HAVE_LCMS1
g_checksum_update (md5,
(const guchar *) data + sizeof (icHeader),
len - sizeof (icHeader));
+#else
+ g_checksum_update (md5,
+ (const guchar *) data + sizeof (cmsICCHeader),
+ len - sizeof (cmsICCHeader));
+#endif
len = 16;
g_checksum_get_digest (md5, digest, &len);
@@ -934,18 +1016,18 @@ lcms_image_transform_rgb (gint32 image,
GimpColorRenderingIntent intent,
gboolean bpc)
{
- cmsHTRANSFORM transform = NULL;
- DWORD last_format = 0;
- gint *layers;
- gint num_layers;
- gint i;
+ cmsHTRANSFORM transform = NULL;
+ cmsUInt32Number last_format = 0;
+ gint *layers;
+ gint num_layers;
+ gint i;
layers = gimp_image_get_layers (image, &num_layers);
for (i = 0; i < num_layers; i++)
{
- GimpDrawable *drawable = gimp_drawable_get (layers[i]);
- DWORD format;
+ GimpDrawable *drawable = gimp_drawable_get (layers[i]);
+ cmsUInt32Number format;
switch (drawable->bpp)
{
diff --git a/plug-ins/file-jpeg/jpeg-load.c b/plug-ins/file-jpeg/jpeg-load.c
index 87267fd..3609029 100644
--- a/plug-ins/file-jpeg/jpeg-load.c
+++ b/plug-ins/file-jpeg/jpeg-load.c
@@ -31,7 +31,12 @@
#endif /* HAVE_LIBEXIF */
#ifdef HAVE_LCMS
+#ifdef HAVE_LCMS1
#include <lcms.h>
+typedef DWORD cmsUInt32Number;
+#else
+#include <lcms2.h>
+#endif
#endif
#include <libgimp/gimp.h>
@@ -966,7 +971,7 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
GimpColorConfig *config = gimp_get_color_configuration ();
cmsHPROFILE cmyk_profile = NULL;
cmsHPROFILE rgb_profile = NULL;
- DWORD flags = 0;
+ cmsUInt32Number flags = 0;
cmsHTRANSFORM transform;
/* try to load the embedded CMYK profile */
@@ -976,7 +981,11 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
if (cmyk_profile)
{
+#ifdef HAVE_LCMS1
if (! cmsGetColorSpace (cmyk_profile) == icSigCmykData)
+#else
+ if (! cmsGetColorSpace (cmyk_profile) == cmsSigCmykData)
+#endif
{
cmsCloseProfile (cmyk_profile);
cmyk_profile = NULL;
@@ -989,7 +998,11 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
{
cmyk_profile = cmsOpenProfileFromFile (config->cmyk_profile, "r");
+#ifdef HAVE_LCMS1
if (cmyk_profile && ! cmsGetColorSpace (cmyk_profile) == icSigCmykData)
+#else
+ if (cmyk_profile && ! cmsGetColorSpace (cmyk_profile) == cmsSigCmykData)
+#endif
{
cmsCloseProfile (cmyk_profile);
cmyk_profile = NULL;
@@ -1008,7 +1021,11 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
{
rgb_profile = cmsOpenProfileFromFile (config->rgb_profile, "r");
+#ifdef HAVE_LCMS1
if (rgb_profile && ! cmsGetColorSpace (rgb_profile) == icSigRgbData)
+#else
+ if (rgb_profile && ! cmsGetColorSpace (rgb_profile) == cmsSigRgbData)
+#endif
{
cmsCloseProfile (rgb_profile);
rgb_profile = NULL;
--
1.8.3.1

View File

@ -81,8 +81,8 @@
Summary: GNU Image Manipulation Program
Name: gimp
Epoch: 2
Version: 2.8.6
Release: %{?prerelprefix}5%{dotprerel}%{dotgitrev}%{?dist}
Version: 2.8.8
Release: %{?prerelprefix}1%{dotprerel}%{dotgitrev}%{?dist}
# Compute some version related macros
# Ugly hack, you need to get your quoting backslashes/percent signs straight
@ -206,24 +206,9 @@ Patch0: gimp-%{version}%{dashprerel}-git%{gitrev}.patch.bz2
# Fedora specific.
Patch1: gimp-2.8.2-cm-system-monitor-profile-by-default.patch
# Exit properly while loading an image (#633107).
# Upstream commit 2dd51be1ce18b11a207efc90e3e8e8c07ba6f7d7 and commit
# bc44719702a5cdcc4944a9a5e1f310c1740c6308
Patch2: gimp-2.8.6-exit-while-loading.patch
# Allow building against lcms2.
# Upstream commits:
# dea42de6c76783ef1bab8f7e4910e26fff75312f
# 0b3eaef82120c3ac764e50c0d5e78be766d4ebf5
# fb40ab72c3e54be46df64916cf6f80cbd6924fbd
Patch3: gimp-2.8.6-lcms2.patch
# use external help browser directly if help browser plug-in is not built
Patch100: gimp-2.8.6-external-help-browser.patch
# Rebuild configure script.
Patch1000: gimp-2.8.6-4-autoconf.patch.bz2
%description
GIMP (GNU Image Manipulation Program) is a powerful image composition and
editing program, which can be extremely useful for creating logos and other
@ -310,15 +295,11 @@ EOF
%endif
%patch1 -p1 -b .cm-system-monitor-profile-by-default
%patch2 -p1 -b .exit-while-loading
%patch3 -p1 -b .lcms2
%if ! %{with helpbrowser}
%patch100 -p1 -b .external-help-browser
%endif
%patch1000 -p1 -b .autoconf
%build
%if %{with hardening}
# Use hardening compiler/linker flags because gimp is likely to deal with files
@ -396,6 +377,10 @@ rm -rf %{buildroot}
# makeinstall macro won't work here - libexec is overriden
make DESTDIR=%{buildroot} install
# "make install" doesn't install appdata file as of version 2.8.8
install -D -m 0644 desktop/gimp.appdata.xml \
%{buildroot}%{_datadir}/appdata/gimp.appdata.xml
# remove rpaths
find %buildroot -type f -print0 | xargs -0 -L 20 chrpath --delete --keepgoing 2>/dev/null || :
@ -502,6 +487,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%doc AUTHORS COPYING ChangeLog NEWS README
%doc docs/*.xcf*
%{_datadir}/applications/*.desktop
%{_datadir}/appdata/*.appdata.xml
%dir %{_datadir}/gimp
%dir %{_datadir}/gimp/%{lib_api_version}
@ -622,6 +608,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Mon Nov 04 2013 Nils Philippsen <nils@redhat.com> - 2:2.8.8-1
- version 2.8.8
* Thu Sep 19 2013 Nils Philippsen <nils@redhat.com> - 2:2.8.6-5
- fix lcms2 patch

View File

@ -1,2 +1 @@
12b3fdf33d1f07ae79b412a9e38b9693 gimp-2.8.6.tar.bz2
243e5137ae2ab8d1c897b3812cfb0694 gimp-2.8.6-4-autoconf.patch.bz2
ef2547c3514a1096931637bd6250635a gimp-2.8.8.tar.bz2