def imageBytes2nsimage(image_bytes: io.BytesIO):
ns_data = NSData.dataWithBytesNoCopy_length_(image_bytes.getvalue(), len(image_bytes.getvalue()))
return NSImage.alloc().initWithData_(ns_data)
image_bytes = io.BytesIO()
image.save(image_bytes, format="TIFF")
ns_image = imageBytes2nsimage(image_bytes)
I do not know how you would cleanly implement and unit test this here, so I thought I would raise an issue.
Thanks.
Hi,
I used the
livetext_from_imagefunction in a loop and recognized that my process piled up memory.Solved it by using
NSData.dataWithBytesNoCopy_length_https://developer.apple.com/documentation/foundation/nsdata/datawithbytesnocopy:length:?language=objc and replacing the Code from Line 210 with thisI do not know how you would cleanly implement and unit test this here, so I thought I would raise an issue.
Thanks.