openexr-rs icon indicating copy to clipboard operation
openexr-rs copied to clipboard

Support arbitrary attributes

Open abusch opened this issue 7 years ago • 5 comments

It looks like OpenEXR supports arbitrary attributes in the header. There are a bunch of standard, but optional, atrtributes defined in https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfStandardAttributes.h

It would be nice to support at least some of them, like owner, comments, or capDate.

I may give it a shot maybe if I can find a bit of time, but might need a little bit of guidance :)

abusch avatar Jan 29 '18 22:01 abusch

Ah, yes! This is definitely something we want to support. Just haven't gotten around to it. I think the main concern is design. The C++ API allows for some C++ specific capabilities with custom attributes, IIRC, so part of the question is simply how far do we go in trying to support that. But at least covering integers, floats, matrices, and strings would be good.

I would be delighted if you wanted to take a crack at it. I don't have tons of time to provide guidance right at this moment, but I'll do my best!

cessen avatar Jan 30 '18 03:01 cessen

I attempted this once previously and found that the built-in extended attributes rely heavily enough on C++ template magic that they cannot be handled generically in C bindings, i.e. they must be painstakingly bound individually. Yes, this seems implausible, but if you dig deep enough I believe you'll come to the same conclusion.

It would certainly be nice to have, though! Non-standard extended attributes can be handled more gracefully, as well.

Ralith avatar Jan 30 '18 03:01 Ralith

@ralith @cessen @abusch For my current project I absolutely need support for (writing) the multiView attribute. This is the only attribute I need to get past a brick wall.

IMF_STD_ATTRIBUTE_DEF (multiView , MultiView, StringVector)

I need a very very short term fix (ie I have zero resource to dedicate to write full arbitrary attributes support) otherwise I cannot progress with my project, a hack if necessary. Any suggestions?

they must be painstakingly bound individually.

In this context, it's acceptable to have a header.set_multi_view(&[&str]]) dedicated call which does one and one thing only.

norru avatar Jul 09 '19 15:07 norru

I'll try to bang that one out; I'll probably want it someday myself.

Ralith avatar Jul 09 '19 16:07 Ralith

See #39

Ralith avatar Jul 09 '19 17:07 Ralith