如何使用libwebp编译Imagick以获得Webp图像支持



我在OSX上本地安装了ImageMagick,Imagick和Webp库,并尝试使用干预图像库将图像另存为Webp,但收到以下错误:

Webp format is not supported by Imagick installation.

在查看干预图像文档(http://image.intervention.io/getting_started/formats(后,我可以看到Imagick扩展需要"在libwebp支持下编译",但是没有执行此操作的说明,经过大量搜索,我找不到解决方案

我通过 pecl 安装了 Imagick - 似乎没有像 --with-libwebp 这样的安装标志,因为似乎曾经使用brew进行安装

PHP 版本: 7.2

图像魔术版本:7.0.8-53

魔法版本:3.4.4

OSX 版本:10.14.5

你必须用 Imagemagick 而不是 Imagick 安装 libwebp。

我认为当使用 webp 从源代码编译它时,您不需要使用 --with libwebp 在 Imagemagick .configuration 文件中做任何特别的事情。

我在OSX Sierra上。我从MacPorts安装所有委托,然后从源代码安装Imagemagick 7.0.8.53。这对我来说效果很好。我所需要的只是让MacPorts与所有其他想要的代表一起安装libwebp。 这是我的配置文件。请注意,没有特殊的 - 包括 webp。

./configure CC=/opt/local/bin/clang-mp-3.9 CXX=/opt/local/bin/clang++-mp-3.9 
CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' 
--enable-openmp 
--enable-delegate-build --enable-shared --disable-static --disable-opencl 
--with-modules --with-quantum-depth=16 --without-wmf --with-rsvg 
--disable-silent-rules --disable-dependency-tracking --without-pango 
--with-lqr --with-gslib --with-gs-font-dir=/opt/local/share/ghostscript/fonts/


I simply do the .configuration ...
Then make clean
Then make
Then sudo make install

我不知道一旦你已经安装了Imagemagick二进制文件,如何安装libwebp。

最新更新