[Bf-blender-cvs] [fccf253] master: Support string metadata loading for OpenEXR files.

Antony Riakiotakis noreply at git.blender.org
Tue May 19 18:32:49 CEST 2015


Commit: fccf253e3677e023e554641b6118366ef6df937e
Author: Antony Riakiotakis
Date:   Tue May 19 18:32:41 2015 +0200
Branches: master
https://developer.blender.org/rBfccf253e3677e023e554641b6118366ef6df937e

Support string metadata loading for OpenEXR files.

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

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 58c5be8..b4f81eb 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1973,6 +1973,21 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags, char
 						}
 					}
 
+					if (flags & IB_metadata) {
+						const Header & header = file->header(0);
+						Header::ConstIterator iter;
+
+						for (iter = header.begin(); iter != header.end(); iter++) {
+							const StringAttribute *attrib = file->header(0).findTypedAttribute <StringAttribute> (iter.name());
+
+							/* not all attributes are string attributes so we might get some NULLs here */
+							if (attrib) {
+								IMB_metadata_add_field(ibuf, iter.name(), attrib->value().c_str());
+								ibuf->flags |= IB_metadata;
+							}
+						}
+					}
+
 					/* file is no longer needed */
 					delete file;
 				}




More information about the Bf-blender-cvs mailing list