美文网首页
Wand安装

Wand安装

作者: myserendipit | 来源:发表于2018-05-07 10:42 被阅读67次

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)

相关文章

网友评论

      本文标题:Wand安装

      本文链接:https://www.haomeiwen.com/subject/sdjmrftx.html