[gimp] Bug 478528 - Layer and Image previews are not color managed
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 478528 - Layer and Image previews are not color managed
- Date: Sun, 6 Sep 2015 12:14:51 +0000 (UTC)
commit f9da5cc6ccaa8fa2ad4ec277837312ecba7101cb
Author: Michael Natterer <mitch gimp org>
Date: Sun Sep 6 14:12:58 2015 +0200
Bug 478528 - Layer and Image previews are not color managed
Fix gimp_color_profile_get_format() to return the right format for
"cairo-RGB24": simply check for the more special cairo formats first,
then check for the general RGB models. Found by Massimo.
libgimpcolor/gimpcolorprofile.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 55f29ba..ffd02ee 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -930,8 +930,8 @@ gimp_color_profile_new_adobe_rgb (void)
* used instead of the passed @format, which usually is the same as
* @format, unless lcms doesn't support @format.
*
- * Note that this function currently only supports RGB, RGBA, R'G'B' and
- * R'G'B'A formats.
+ * Note that this function currently only supports RGB, RGBA, R'G'B',
+ * R'G'B'A and the cairo-RGB24 and cairo-ARGB32 formats.
*
* Return value: the #Babl format to be used instead of @format, or %NULL
* is the passed @format is not supported at all.
@@ -955,17 +955,7 @@ gimp_color_profile_get_format (const Babl *format,
type = babl_format_get_type (format, 0);
model = babl_format_get_model (format);
- if (model == babl_model ("RGB") ||
- model == babl_model ("RGBA"))
- {
- linear = TRUE;
- }
- else if (model == babl_model ("R'G'B'") ||
- model == babl_model ("R'G'B'A"))
- {
- linear = FALSE;
- }
- else if (format == babl_format ("cairo-RGB24"))
+ if (format == babl_format ("cairo-RGB24"))
{
*lcms_format = TYPE_RGB_8;
@@ -977,6 +967,16 @@ gimp_color_profile_get_format (const Babl *format,
return babl_format ("R'G'B'A u8");
}
+ else if (model == babl_model ("RGB") ||
+ model == babl_model ("RGBA"))
+ {
+ linear = TRUE;
+ }
+ else if (model == babl_model ("R'G'B'") ||
+ model == babl_model ("R'G'B'A"))
+ {
+ linear = FALSE;
+ }
else
{
g_printerr ("format: %s\n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]