diff --git a/libgimp/gimpmetadata.c b/libgimp/gimpmetadata.c index 2a49cfc2ae..402d83c12d 100644 --- a/libgimp/gimpmetadata.c +++ b/libgimp/gimpmetadata.c @@ -175,6 +175,32 @@ gimp_image_metadata_load_finish (gint32 image_ID, metadata, interactive); } + if (flags & GIMP_METADATA_LOAD_COLORSPACE) + { + gchar *value; + + value = gexiv2_metadata_get_tag_interpreted_string (metadata, + "Exif.Iop.InteroperabilityIndex"); + + if (! g_strcmp0 (value, "R03")) + { + GimpColorProfile *profile = gimp_image_get_color_profile (image_ID); + + if (! profile) + { + /* honor the R03 InteroperabilityIndex only if the + * image didn't contain an ICC profile + */ + profile = gimp_color_profile_new_adobe_rgb (); + gimp_image_set_color_profile (image_ID, profile); + } + + g_object_unref (profile); + } + + g_free (value); + } + gimp_image_set_metadata (image_ID, metadata); } diff --git a/libgimpbase/gimpmetadata.h b/libgimpbase/gimpmetadata.h index 03bca872dd..6e6320e878 100644 --- a/libgimpbase/gimpmetadata.h +++ b/libgimpbase/gimpmetadata.h @@ -29,6 +29,7 @@ typedef enum GIMP_METADATA_LOAD_COMMENT = 1 << 0, GIMP_METADATA_LOAD_RESOLUTION = 1 << 1, GIMP_METADATA_LOAD_ORIENTATION = 1 << 2, + GIMP_METADATA_LOAD_COLORSPACE = 1 << 3, GIMP_METADATA_LOAD_ALL = 0xffffffff } GimpMetadataLoadFlags;