Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/oiio/openimageio_api.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
index 7a47d0f7787..d2147f833c3 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
@@ -197,6 +197,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
bool is_float, is_alpha;
int basesize;
char file_colorspace[IM_MAX_SPACE];
+ const bool is_colorspace_manually_set = (colorspace[0] != '\0');
/* load image from file through OIIO */
if (imb_is_a_photoshop(filename) == 0) {
@@ -221,17 +222,19 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
return NULL;
}
- string ics = spec.get_string_attribute("oiio:ColorSpace");
- BLI_strncpy(file_colorspace, ics.c_str(), IM_MAX_SPACE);
+ if (!is_colorspace_manually_set) {
+ string ics = spec.get_string_attribute("oiio:ColorSpace");
+ BLI_strncpy(file_colorspace, ics.c_str(), IM_MAX_SPACE);
- /* only use colorspaces exis */
- if (colormanage_colorspace_get_named(file_colorspace)) {
- strcpy(colorspace, file_colorspace);
- }
- else {
- std::cerr << __func__ << ": The embed colorspace (\"" << file_colorspace
- << "\") not supported in existent OCIO configuration file. Fallback "
- << "to system default colorspace (\"" << colorspace << "\")." << std::endl;
+ /* only use colorspaces exis */
+ if (colormanage_colorspace_get_named(file_colorspace)) {
+ strcpy(colorspace, file_colorspace);
+ }
+ else {
+ std::cerr << __func__ << ": The embed colorspace (\"" << file_colorspace
+ << "\") not supported in existent OCIO configuration file. Fallback "
+ << "to system default colorspace (\"" << colorspace << "\")." << std::endl;
+ }
}
width = spec.width;