summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eom-image.c6
-rw-r--r--src/eom-image.h2
-rw-r--r--src/eom-metadata-reader-jpg.c8
-rw-r--r--src/eom-metadata-reader-png.c8
-rw-r--r--src/eom-metadata-reader.h2
-rw-r--r--src/eom-window.c11
6 files changed, 12 insertions, 25 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index e3f1c23..989f365 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -58,7 +58,7 @@
#endif
#ifdef HAVE_LCMS
-#include <lcms.h>
+#include <lcms2.h>
#ifndef EXIF_TAG_GAMMA
#define EXIF_TAG_GAMMA 0xa500
#endif
@@ -681,8 +681,8 @@ eom_image_apply_display_profile (EomImage *img, cmsHPROFILE screen)
if (screen == NULL || priv->profile == NULL) return;
/* TODO: support other colorspaces than RGB */
- if (cmsGetColorSpace (priv->profile) != icSigRgbData ||
- cmsGetColorSpace (screen) != icSigRgbData) {
+ if (cmsGetColorSpace (priv->profile) != cmsSigRgbData ||
+ cmsGetColorSpace (screen) != cmsSigRgbData) {
eom_debug_message (DEBUG_LCMS, "One or both ICC profiles not in RGB colorspace; not correcting");
return;
}
diff --git a/src/eom-image.h b/src/eom-image.h
index 0640762..5e3fe84 100644
--- a/src/eom-image.h
+++ b/src/eom-image.h
@@ -37,7 +37,7 @@
#endif
#ifdef HAVE_LCMS
-#include <lcms.h>
+#include <lcms2.h>
#endif
#ifdef HAVE_EXEMPI
diff --git a/src/eom-metadata-reader-jpg.c b/src/eom-metadata-reader-jpg.c
index 5d6a79c..9fc79b7 100644
--- a/src/eom-metadata-reader-jpg.c
+++ b/src/eom-metadata-reader-jpg.c
@@ -513,8 +513,6 @@ eom_metadata_reader_jpg_get_icc_profile (EomMetadataReaderJpg *emr)
priv = emr->priv;
if (priv->icc_chunk) {
- cmsErrorAction (LCMS_ERROR_SHOW);
-
profile = cmsOpenProfileFromMem(priv->icc_chunk + 14, priv->icc_len - 14);
if (profile) {
@@ -562,7 +560,7 @@ eom_metadata_reader_jpg_get_icc_profile (EomMetadataReaderJpg *emr)
{
cmsCIExyY whitepoint;
cmsCIExyYTRIPLE primaries;
- LPGAMMATABLE gamma[3];
+ cmsToneCurve *gamma[3];
double gammaValue;
ExifRational r;
@@ -619,11 +617,11 @@ eom_metadata_reader_jpg_get_icc_profile (EomMetadataReaderJpg *emr)
gammaValue = 2.2;
}
- gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma (256, gammaValue);
+ gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma (NULL, gammaValue);
profile = cmsCreateRGBProfile (&whitepoint, &primaries, gamma);
- cmsFreeGamma(gamma[0]);
+ cmsFreeToneCurve(gamma[0]);
eom_debug_message (DEBUG_LCMS, "JPEG is calibrated");
diff --git a/src/eom-metadata-reader-png.c b/src/eom-metadata-reader-png.c
index 242e52a..c475e06 100644
--- a/src/eom-metadata-reader-png.c
+++ b/src/eom-metadata-reader-png.c
@@ -563,8 +563,6 @@ eom_metadata_reader_png_get_icc_profile (EomMetadataReaderPng *emr)
return NULL;
}
- cmsErrorAction (LCMS_ERROR_SHOW);
-
profile = cmsOpenProfileFromMem(outbuf, zstr.total_out);
inflateEnd (&zstr);
g_free (outbuf);
@@ -583,7 +581,7 @@ eom_metadata_reader_png_get_icc_profile (EomMetadataReaderPng *emr)
if (!profile && priv->cHRM_chunk) {
cmsCIExyY whitepoint;
cmsCIExyYTRIPLE primaries;
- LPGAMMATABLE gamma[3];
+ cmsToneCurve *gamma[3];
double gammaValue = 2.2; // 2.2 should be a sane default gamma
/* This uglyness extracts the chromacity and whitepoint values
@@ -611,11 +609,11 @@ eom_metadata_reader_png_get_icc_profile (EomMetadataReaderPng *emr)
if (priv->gAMA_chunk)
gammaValue = (double) 1.0/EXTRACT_DOUBLE_UINT_BLOCK_OFFSET (priv->gAMA_chunk, 0, 100000);
- gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma (256, gammaValue);
+ gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma (NULL, gammaValue);
profile = cmsCreateRGBProfile (&whitepoint, &primaries, gamma);
- cmsFreeGamma(gamma[0]);
+ cmsFreeToneCurve(gamma[0]);
}
return profile;
diff --git a/src/eom-metadata-reader.h b/src/eom-metadata-reader.h
index 5d719a1..ce5dc0c 100644
--- a/src/eom-metadata-reader.h
+++ b/src/eom-metadata-reader.h
@@ -30,7 +30,7 @@
#include <exempi/xmp.h>
#endif
#if HAVE_LCMS
-#include <lcms.h>
+#include <lcms2.h>
#endif
G_BEGIN_DECLS
diff --git a/src/eom-window.c b/src/eom-window.c
index 1c67eff..3ba7259 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -72,7 +72,7 @@
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
-#include <lcms.h>
+#include <lcms2.h>
#endif
#define EOM_WINDOW_GET_PRIVATE(object) \
@@ -652,17 +652,8 @@ eom_window_get_display_profile (GdkScreen *screen)
return NULL;
}
- /* Make lcms errors non-fatal here, as it is possible
- * to load invalid profiles with XICC.
- * We don't want lcms to abort EOM in that case.
- */
- lcms_error_action = cmsErrorAction (LCMS_ERROR_IGNORE);
-
profile = cmsOpenProfileFromMem (str, length);
- // Restore the previous error setting
- cmsErrorAction (lcms_error_action);
-
if (G_UNLIKELY (profile == NULL)) {
eom_debug_message (DEBUG_LCMS,
"Invalid display profile, "