MAC环境安装imagemagick

来源:互联网 发布:十本法术工厂升级数据 编辑:程序博客网 时间:2024/06/07 18:40

项目“验证码识别”的前期准备过程

  1. 安装 xQuartz 关于MAC 版x11

  2. 利用homebrew安装ghostscript

$ brew install ghostscript

若提示错误

Warning: ghostscript-9.21_1 already installed, it's just not linked.$ brew link --overwrite ghostscriptLinking /usr/local/Cellar/ghostscript/9.21_1...Error: Could not symlink share/ghostscript/9.21/usr/local/share/ghostscript is not writable.

This would probably be an issue non specific to the packages being installed but of the permissions of homebrew folders.
解决方案

$ sudo chown -R `whoami`:admin /usr/local/share$ brew link --overwrite ghostscript

安装成功,查看版本

$ gs -vGPL Ghostscript 9.21 (2017-03-16)Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.

安装imagemagick

$ brew install imagemagick

link列表中的libpng

$ brew link libpng

测试:转换pdf为png

$ convert -density 72 a.pdf a.png
原创粉丝点击