Wand安装
Wand是一个基于ctypes的Python ImagedMagick绑定库。
PythonMagick是ImageMagick的一个面向对象的Python接口。
PythonMagickWand是基于ctypes的MagickWand的一个面向对象的Python接口。
step 1
目前ImageMagick7因兼容性问题无法使用dylib
,所以现在装的是第6版
pip install wand
brew install freetype
brew install imagemagick@6
brew link imagemagick@6 --force
step 2
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH" >> ~/.zshrc
step 3
运行测试,进入python环境,准备一张图片;运行正常即可打印图片的宽高
from wand.image import Image
with Image(filename='test.jpg') as img:
print(img.size)
网友评论