Hi Daniel that looks like exactly what I’m after, thanks!

On Thu, 4 Aug 2022 at 20:45, Daniel Flehner Heen <flehnerhee...@gmail.com>
wrote:

> 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 <anderslangla...@gmail.com>
> 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
>> Oiio-dev@lists.openimageio.org
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
>>
>
> --
> -Daniel
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to