Back

安装 imagemagic (install imagemagic)

发布时间: 2013-09-03 21:47:00

参考: http://rmagick.rubyforge.org/install2-linux.html

ruby1.9只能安装 rmagick2. 而rmagick2 对应的 imagemagic版本是6.4 以上。

$ wget http://www.imagemagick.org/download/ImageMagick.tar.gz
$ tar zxvf ImageMagick.tar.gz
$ cd ImageMagic-x.
$
./configure --disable-static --with-modules --without-perl \
--without-magick-plus-plus --with-quantum-depth=8 \
--with-gs-font-dir=$FONTS
$ make
$ make install

$ gem install rmagick

继续:。。。

vim ~/.bashrc
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
ln -s /usr/local/include/ImageMagick/wand /usr/local/include/wand
ln -s /usr/local/include/ImageMagick/magick /usr/local/include/magick

然后。。。安装rmagick GEM 还是失败了。

不过没关系,我们绕过gem , 直接调用 convert 这个函数!!!!!

$ convert lala.jpg -bordercolor SkyBlue -border 0x20 lala2.jpg
-bordercolor 没问题了。 -border 0x20 ,表示 左右的border 是0, 上下 是20

Back