summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4f9490)
raw | patch | inline | side by side (parent: e4f9490)
author | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Sep 2007 02:48:50 +0000 (02:48 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Thu, 27 Sep 2007 02:48:50 +0000 (02:48 +0000) |
src/color-profile.cpp | patch | blob | history |
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 46bd1b803f972363c47ed81271d7333d1d6eb4cc..dbd212bd619fe911f891f640342c5d5005878211 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
if ( which && uri && *uri ) {
if ( lastURI != std::string(uri) ) {
+ lastURI.clear();
if ( theOne ) {
cmsCloseProfile( theOne );
}
theOne = cmsOpenProfileFromFile( uri, "r" );
if ( theOne ) {
- lastURI = uri;
+ // a display profile must have the proper stuff
+ icColorSpaceSignature space = cmsGetColorSpace(theOne);
+ icProfileClassSignature profClass = cmsGetDeviceClass(theOne);
+
+ if ( profClass != icSigDisplayClass ) {
+ g_warning("Not a display profile");
+ cmsCloseProfile( theOne );
+ theOne = 0;
+ } else if ( space != icSigRgbData ) {
+ g_warning("Not an RGB profile");
+ cmsCloseProfile( theOne );
+ theOne = 0;
+ } else {
+ lastURI = uri;
+ }
}
}
} else if ( theOne ) {