ResetImagePixels: Assertion `image != (Image *) NULL' failed. #530
-
I all I have a problem using wandImage.from_array using a big nparray. That's my code (typeToUse is np.uint8, h_swath is 1024 and x is 31496): np_array = np.ones(shape=(h_swath, x), dtype=typeToUse) * 255 On wandImage.from_array call the script dump and the error is the seguent: python3: ../../magick/image.c:2300: ResetImagePixels: Assertion `image != (Image *) NULL' failed. I use that code on a windows installation and I don't have that problem, now I install all the environment on a Ubuntu machine (5.8.0-50-generic #56~20.04.1-Ubuntu SMP) using that package: $ dpkg -l | grep wand Any suggest to avoid that problem? I also use gdb, but I don't found any helpfull indication. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The error means that the pixel data was removed from memory before the rest cycle completed. Possibly due to limited resources, but I would suspect that Python's fastbin saw with wandImage.from_array(np_array, b'R') as img:
.... Note: I'm assuming you want |
Beta Was this translation helpful? Give feedback.
The error means that the pixel data was removed from memory before the rest cycle completed. Possibly due to limited resources, but I would suspect that Python's fastbin saw
wandImage(wandImage.from_array(...))
and optimized it away. Try this...Note: I'm assuming you want
b'R'
as this is a grayscale image, notb'I'
which would be index.