[eog] Allow color correcting images with alpha channel
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Allow color correcting images with alpha channel
- Date: Mon, 3 Mar 2014 22:04:55 +0000 (UTC)
commit 80b536bcd2f08f314e10f47d3689283c7ae577a6
Author: pdknsk <pdknsk gmail com>
Date: Mon Mar 3 22:58:16 2014 +0100
Allow color correcting images with alpha channel
This is mostly useful for PNG images for now but could also help
with TIFF files in the future. LittleCMS will still ignore the
alpha channel, so this should be harmless.
https://bugzilla.gnome.org/show_bug.cgi?id=725357
src/eog-image.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/eog-image.c b/src/eog-image.c
index d94604a..1b7ef7e 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -709,18 +709,17 @@ eog_image_apply_display_profile (EogImage *img, cmsHPROFILE screen)
return;
}
- /* TODO: find the right way to colorcorrect RGBA images */
- if (gdk_pixbuf_get_has_alpha (priv->image)) {
- eog_debug_message (DEBUG_LCMS, "Colorcorrecting RGBA images is unsupported.");
- return;
- }
+ cmsUInt32Number color_type = TYPE_RGB_8;
+
+ if (gdk_pixbuf_get_has_alpha (priv->image))
+ color_type = TYPE_RGBA_8;
transform = cmsCreateTransform (priv->profile,
- TYPE_RGB_8,
- screen,
- TYPE_RGB_8,
- INTENT_PERCEPTUAL,
- 0);
+ color_type,
+ screen,
+ color_type,
+ INTENT_PERCEPTUAL,
+ 0);
if (G_LIKELY (transform != NULL)) {
rows = gdk_pixbuf_get_height (priv->image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]