I am using ImageMagick library with Python ctypes
. I wrote a following simple code, but it crashes with segmentation fault (KERN_INVALID_ADDRESS
) in Mac:
from ctypes import *
from ctypes.util import find_library
lib = CDLL(find_library( MagickWand ))
lib.MagickWandGenesis()
wand = lib.NewMagickWand()
lib.MagickReadImage(wand, mona-lisa.jpg )
lib.DestroyMagickWand(wand)
lib.MagickWandTerminus()
该公司在北纬度和视窗两方面都运行良好,但只在麦克斯温斯角运行。 我以各种方式建立了图像模型(官方双轨制包、家装、传统<代码>/configure &&使),但每次试验都坠毁。
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000009a7638
0x000000010149a8d1 in MagickReadImage ()
不仅在<代码>MagickReadImage()功能上,IsMagickWand(
功能也发生故障。 我只想NewMagickWand(
>回到错误的点子,或ctype
in Mac Hands Pointers不正确,但我并不肯定。
这种情况有什么错误?