[liblcms=$enableval], [liblcms=auto])
if test "x${liblcms}" != "xno"; then
- PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
+ PKG_CHECK_MODULES(LCMS, [lcms2 >= 2.0],
[
HAVE_LCMS=yes
AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with lcms])
+ AC_DEFINE(HAVE_LCMS2, 1, [lcms2 is used])
],
[
- HAVE_LCMS=no
- AC_MSG_WARN([$LCMS_PKG_ERRORS])
+ PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
+ [
+ HAVE_LCMS=yes
+ AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with lcms])
+ ],
+ [
+ HAVE_LCMS=no
+ AC_MSG_WARN([$LCMS_PKG_ERRORS])
+ ])
])
else
HAVE_LCMS=disabled
#ifdef HAVE_LCMS
/*** color support enabled ***/
+#ifdef HAVE_LCMS2
+#include <lcms2.h>
+#else
#include <lcms.h>
+#endif
typedef struct _ColorManCache ColorManCache;
if (init_done) return;
init_done = TRUE;
+#ifndef HAVE_LCMS2
cmsErrorAction(LCMS_ERROR_IGNORE);
+#endif
}
static cmsHPROFILE color_man_create_adobe_comp(void)
case COLOR_PROFILE_FILE:
if (profile)
{
+#ifdef HAVE_LCMS2
+ cmsUInt8Number profileID[17];
+ profileID[16] = '\0';
+ cmsGetHeaderProfileID(profile, profileID);
+ return g_strdup(profileID);
+#else
return g_strdup(cmsTakeProductName(profile));
+#endif
}
return g_strdup(_("Custom profile"));
break;
if (!cm) return FALSE;
cc = cm->profile;
-
+
if (image_profile) *image_profile = color_man_get_profile_name(cc->profile_in_type, cc->profile_in);
if (screen_profile) *screen_profile = color_man_get_profile_name(cc->profile_out_type, cc->profile_out);
return TRUE;
#ifdef HAVE_LCMS
/*** color support enabled ***/
-#ifdef HAVE_LCMS_LCMS_H
- #include <lcms/lcms.h>
+#ifdef HAVE_LCMS2
+#include <lcms2.h>
#else
- #include <lcms.h>
+#include <lcms.h>
#endif
#endif
static gboolean remove_suffix(gchar *str, const gchar *suffix, gint suffix_len)
{
gint str_len = strlen(str);
-
+
if (suffix_len < 0) suffix_len = strlen(suffix);
if (str_len < suffix_len) return FALSE;
-
+
if (strcmp(str + str_len - suffix_len, suffix) != 0) return FALSE;
str[str_len - suffix_len] = '\0';
-
+
return TRUE;
}
gint i, j;
g_strstrip(software);
-
+
/* remove superfluous spaces (pentax K100D) */
for (i = 0, j = 0; software[i]; i++, j++)
{
static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
{
+#ifdef HAVE_LCMS2
+ cmsUInt8Number profileID[17];
+#endif
const gchar *name = "";
const gchar *source = "";
guchar *profile_data;
profile = cmsOpenProfileFromMem(profile_data, profile_len);
if (profile)
{
+#ifdef HAVE_LCMS2
+ profileID[16] = '\0';
+ cmsGetHeaderProfileID(profile, profileID);
+ name = profileID;
+#else
name = cmsTakeProductName(profile);
+#endif
cmsCloseProfile(profile);
}
g_free(profile_data);
ExifData *exif_read_fd(FileData *fd)
{
gchar *sidecar_path;
-
+
if (!exif_cache) exif_init_cache();
if (!fd) return NULL;
-
+
if (file_cache_get(exif_cache, fd)) return fd->exif;
g_assert(fd->exif == NULL);
-
+
/* CACHE_TYPE_XMP_METADATA file should exist only if the metadata are
* not writable directly, thus it should contain the most up-to-date version */
sidecar_path = NULL;
/* Turns out that the packing used by TIFFRGBAImage depends on
* the host byte order...
*/
- while (pixels < pixbuf->pixels + bytes)
+ while (pixels < lt->pixbuf->pixels + bytes)
{
uint32 pixel = *(uint32 *)pixels;
int r = TIFFGetR(pixel);
-#endif
\ No newline at end of file
+#endif