Open roelandschoukens opened 2 months ago
Thanks for reporting this. Sadly, I'm unable to reproduce this. Would you be able to share more info on the system experiencing this OSError
?
OK that colour
package imports rather more other stuff than I expected, it can be narrowed down to PySide6
. (this is the official Python Qt binding.)
import numpy as np
from wand.image import Image
import PySide6
with Image.from_array(np.linspace(0, 1, 256*256).reshape([256, 256])) as img:
img.save(filename=f'test.exr')
print("saved")
I tried to reproduce it with a build of ImageMagick I built locally but with that build it actually works correctly. And unfortunately the Windows binaries from ImageMagick themselves are built without debug symbols.
It is crashing when CORE_RL_exr_.dll
tries to call the standard library, and it is getting a msvcp140.dll
that is perhaps slightly incompatible with the one shipped with ImageMagick.
> msvcp140.dll!00007ffb29933080() Unknown Non-user code. Symbol loading disabled by Include/Exclude setting.
CORE_RL_exr_.dll!00007ffb00ef8d6a() Unknown Non-user code. Binary was not built with debug information.
CORE_RL_exr_.dll!00007ffb00ef5a3a() Unknown Non-user code. Binary was not built with debug information.
(it is getting . . . \site-packages\shiboken6\msvcp140.dll
instead of the one in the ImageMagick directory. This possibly explains why sometimes you can fix the issue by calling wand_genesis first)
The last module I can narrow it down to is shiboken6
, which is kind of, sort of part of Qt.
I think this is some generic possible problem if a lot of modules are importing DLLs. Shiboken has a slightly older version of msvcp140.dll
than ImageMagick, perhaps the latter uses a function that was added in the meantime.
test:
This will raise an exception from the
save()
call.This problem started happening after I upgraded ImageMagick:
and