summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-07-08 17:14:12 -0400
committerraveit65 <[email protected]>2019-09-12 16:00:11 +0200
commitc98314bc4d1ec5a1e1df3a43128ad382de3091e7 (patch)
tree5a30ce57d9248d273ad8c6de16554013abd97bc1 /src
parent1c705581c5d344a178f938a4beb868314cb0b2db (diff)
downloadeom-c98314bc4d1ec5a1e1df3a43128ad382de3091e7.tar.bz2
eom-c98314bc4d1ec5a1e1df3a43128ad382de3091e7.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
Diffstat (limited to 'src')
-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 8e52832..b4bf960 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);