From 5ac7e23e886361f7d74d5d6367e63b688bcda361 Mon Sep 17 00:00:00 2001 From: Martijn Berger Date: Sat, 31 Jan 2015 17:15:43 +0100 Subject: Blender metadata changes to accommodate non string data Work towards T42418 For now got rid of linked list holding key,value pairs for metadata in favour of ID properties. Reviewers: campbellbarton, sergey Reviewed By: sergey Projects: #bf_blender Differential Revision: https://developer.blender.org/D872 --- source/blender/imbuf/intern/openexr/openexr_api.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to '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 ad19c547db3..5de243845a4 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -60,6 +60,8 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void) #include "BLI_math_color.h" #include "BLI_threads.h" +#include "BKE_idprop.h" + #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "IMB_allocimbuf.h" @@ -305,10 +307,15 @@ static void openexr_header_compression(Header *header, int compression) static void openexr_header_metadata(Header *header, struct ImBuf *ibuf) { - ImMetaData *info; + if (ibuf->metadata) { + IDProperty *prop; - for (info = ibuf->metadata; info; info = info->next) - header->insert(info->key, StringAttribute(info->value)); + for (prop = (IDProperty *)ibuf->metadata->data.group.first; prop; prop = prop->next) { + if (prop->type == IDP_STRING) { + header->insert(prop->name, StringAttribute(IDP_String(prop))); + } + } + } if (ibuf->ppm[0] > 0.0) addXDensity(*header, ibuf->ppm[0] / 39.3700787); /* 1 meter = 39.3700787 inches */ -- cgit v1.2.3