[Bf-blender-cvs] [dceb8d37c2c] master: Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.

Brecht Van Lommel noreply at git.blender.org
Fri Feb 23 14:52:45 CET 2018


Commit: dceb8d37c2c7acfe42a95e7947cb7324c1b1e9a1
Author: Brecht Van Lommel
Date:   Fri Feb 23 14:32:17 2018 +0100
Branches: master
https://developer.blender.org/rBdceb8d37c2c7acfe42a95e7947cb7324c1b1e9a1

Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.

===================================================================

M	source/blender/imbuf/intern/openexr/openexr_api.cpp

===================================================================

diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 539b9fa45b4..4cb1c13a44a 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1290,7 +1290,7 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
 		return 1;
 	}
 
-	/* last token is single character channel identifier */
+	/* last token is channel identifier */
 	len = imb_exr_split_token(name, end, &token);
 	if (len == 0) {
 		printf("multilayer read: bad channel name: %s\n", name);
@@ -1319,10 +1319,30 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
 				ok = true;
 			}
 		}
+		else if (BLI_strcaseeq(token, "red")) {
+			echan->chan_id = 'R';
+			ok = true;
+		}
+		else if (BLI_strcaseeq(token, "green")) {
+			echan->chan_id = 'G';
+			ok = true;
+		}
+		else if (BLI_strcaseeq(token, "blue")) {
+			echan->chan_id = 'B';
+			ok = true;
+		}
+		else if (BLI_strcaseeq(token, "alpha")) {
+			echan->chan_id = 'A';
+			ok = true;
+		}
+		else if (BLI_strcaseeq(token, "depth")) {
+			echan->chan_id = 'Z';
+			ok = true;
+		}
 
 		if (ok == false) {
 			BLI_strncpy(tokenbuf, token, std::min(len + 1, EXR_TOT_MAXNAME));
-			printf("multilayer read: channel token too long: %s\n", tokenbuf);
+			printf("multilayer read: unknown channel token: %s\n", tokenbuf);
 			return 0;
 		}
 	}



More information about the Bf-blender-cvs mailing list