Open
Description
Running the following script causes OpenEXR 3.3.3 to crash (the output "Done" never appears):
import OpenEXR
import numpy as np
w, h = 640, 480
rgb = np.zeros((w, h, 3), dtype=np.float32)
header = {
"type": OpenEXR.scanlineimage,
"compression": OpenEXR.ZIP_COMPRESSION,
"displayWindow": ((0, 0), (w - 1, h - 1)),
"dataWindow": ((0, 0), (50, 100)),
}
part = OpenEXR.Part(header, {"RGB": rgb})
f = OpenEXR.File([part])
print("Writing...")
f.write("output.exr")
print("Done")
This is because the dataWindow
provided in the header is inconsistent with the shape of the rgb
ndarray. Correcting this aspect of the header allows the file to be written successfully.
Ideally the Python binding would raise an exception in this scenario.