Hi!
I hope I didn't misunderstand your question, but this should work:
import OpenImageIO as oiio
buf = oiio.ImageBuf('/path/to/imagefile.exr')
buf.specmod().attribute('MyAttribute', 'my value')
buf.write('/path/to/modified/imagefile.exr')
Please note:
I'm not sure you can avoid writing the whole file even if you overwrite the
original.
However creating an ImageBuf this way doesn't read the pixel data until
write time or manipulated through ImageBufAlgo for instance.
On Thu, Aug 4, 2022 at 5:14 AM Anders Langlands <[email protected]>
wrote:
> I want to open an image file and just set a few attributes in the header,
> then save it again not touching the image data at all. What's the
> quickest/easiest way to do this in the python API?
>
> Cheers,
> Anders
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
--
-Daniel
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org