I'm trying to use embedded python code that receives an Iris %Stream.GlobalBinary and uses image manipulation library PIL.
Because PIL can't work with IRIS %Stream, I need to convert the image to python bytes.
This process seems to have very bad performance compared to writing to a file and then loading it from a file in python.
Is there a better way to send a stream into python? The conversion code I'm using is below.
Thanks.
defiris_stream_to_bytes(stream):
stream.Rewind()
s = ""whilenot stream.AtEnd:
r = stream.Read(1024)
s += r
b = bytearray()
b.extend(map(ord, s))
return b