diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-09-27 02:48:50 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-09-27 02:48:50 +0000 |
| commit | f9fa4118886e8a67527ff2d10d813b660b6d1204 (patch) | |
| tree | 89591794789e0d173d955cde232951cf33c6e30d /src/color-profile.cpp | |
| parent | remove obsolete import-as-pattern option (diff) | |
| download | inkscape-f9fa4118886e8a67527ff2d10d813b660b6d1204.tar.gz inkscape-f9fa4118886e8a67527ff2d10d813b660b6d1204.zip | |
Disallow all but RGB Display profiles for previewing
(bzr r3808)
Diffstat (limited to 'src/color-profile.cpp')
| -rw-r--r-- | src/color-profile.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 46bd1b803..dbd212bd6 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -380,12 +380,27 @@ cmsHPROFILE Inkscape::colorprofile_get_system_profile_handle() 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 ) { |
