Open shiukaheng opened 3 months ago
You're right, the current python bindings only support file I/O, even though the underlying library supports streams.
I'm in the process of entirely rewriting the bindings (#1756), I can add support for byte streams.
Description:
I encountered an issue when trying to use
OpenEXR.OutputFile
to write to aBytesIO
buffer. The operation fails with the following error:OSError: Cannot open image file "". file write failed
. It appears thatOpenEXR.OutputFile
does not handle in-memory buffers as expected.Steps to Reproduce:
Run the following Python code:
Expected Behavior:
OpenEXR.OutputFile
should support writing to aBytesIO
buffer without raising an error.I am not very C++ savvy but it seems that the C++ implementation and the python wrapper would handle a byte stream for image writing? Especially when reading from a byte stream is supported.
Appreciate any help. Thanks!
Environment: