I think that's the most easiest strategy -- try to seek to subimage 1 and if it succeeds, it's multi-part. Unless you are very displeased with this aesthetically, I think it's a reasonable approach, will work for all image file formats, and actually is fairly efficient.
If it would be helpful, I think I could make the exr reader add a special bit of metadata to indicate this without having to do the seek. This approach would work for openexr, but it wouldn't necessarily be reliable for all image file formats, some of which really have no way of knowing if there are subsequent images without reading more of the file. > On Sep 16, 2019, at 8:14 PM, Renaud Talon <renaudta...@fusefx.com> wrote: > > Hi, > > I’m trying to figure out the proper or best way to detect if and EXR image > was rendered using multi-part. I went through the OIIO documentation and > couldn’t find any info regarding this. > I also cannot find any metadata that seem to indicate if the EXR was rendered > using multi-part or not. > > Right now I am using the following code to identity mutli-part EXRs but this > doesn’t seem like the way to go. Thanks. > > > print(srcImg.seek_subimage(1, 0)) > > >> True # if EXR was rendered using multi-part > or > >> False # if EXR was NOT rendered using multi-part > _______________________________________________ > Oiio-dev mailing list > Oiio-dev@lists.openimageio.org <mailto:Oiio-dev@lists.openimageio.org> > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org> -- Larry Gritz l...@larrygritz.com
_______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org