summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-07-08 17:14:12 -0400
committerraveit65 <[email protected]>2019-07-14 08:44:54 +0200
commit28544c2266388d0df5f0824d0de45a2dc3382f02 (patch)
treef8b079b50bb878606f63198407aa3db942cbfafd
parentf7d104e7379b3915c2d9557da64f34d09f7c142a (diff)
downloadeom-28544c2266388d0df5f0824d0de45a2dc3382f02.tar.bz2
eom-28544c2266388d0df5f0824d0de45a2dc3382f02.tar.xz
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 upstream commit: https://gitlab.gnome.org/GNOME/eog/commit/80b536bc
-rw-r--r--src/eom-image.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index f173a2f..f8add9d 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -667,18 +667,17 @@ eom_image_apply_display_profile (EomImage *img, cmsHPROFILE screen)
return;
}
- /* TODO: find the right way to colorcorrect RGBA images */
- if (gdk_pixbuf_get_has_alpha (priv->image)) {
- eom_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);