Re: List of all availabe attributes in an exr file

Larry Gritz <[email protected]>
Newsgroups gmane.comp.video.openexr.devel
Message-ID <[email protected]>
It is certainly possible to iterate over the full metadata of an OpenEXR file.

	Imf::Header *header = ...;
        for (Imf::Header::ConstIterator hit = header->begin();
             hit != header->end();  ++hit) {
	    std::cout << "name = " << hit.name() 
                      << ", type = " << hit.attribute().typeName() << "\n";
        }


For a full example, look at this portion of the OpenImageIO code:
https://github.com/OpenImageIO/oiio/blob/master/src/openexr.imageio/exrinput.cpp
look at the loop beginning at line 530.




On Nov 19, 2013, at 12:48 AM, Blecher Wolf <[email protected]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Hi,
> 
> we are currently implementing OpenEXR as an internal exchange/storage format for some processed medical images.
> Since we need to store a variety of metadata (realized by storing several attributes) depending on the actual image type, we would like to query a list of attributes present in the file.
> As far as I have seen, the implementation (version 2.0.1) does not provide a method for this, so my idea was to store an additional attribute (StringVector) which contains the available attributes and their static typename.
> Any better ideas?
> 
> Cheers
> 
> Wolf

--
Larry Gritz
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.