【问题标题】:How to compile Imagick with libwebp for Webp image support如何使用 libwebp 编译 Imagick 以获得 Webp 图像支持
【发布时间】:2019-11-22 06:58:37
【问题描述】:
我在 OSX 上本地安装了 ImageMagick、Imagick 和 Webp 库,并尝试使用 Intervention Image 库将图像保存为 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
ImageMagick 版本:7.0.8-53
Imagick 版本:3.4.4
OSX 版本:10.14.5
【问题讨论】:
标签:
imagemagick
imagick
pecl
webp
intervention
【解决方案1】:
您必须使用 Imagemagick 安装 libwebp,而不是 Imagick。
我认为在使用 webp 从源代码编译 Imagemagick .configuration 文件时,您不需要使用 --with libwebp 对其进行任何特殊处理。
我在 OSX Sierra 上。我从 MacPorts 安装了我的所有代表,然后从源代码安装了 Imagemagick 7.0.8.53。这对我很有效。我所需要的只是让 MacPorts 和我所有其他想要的代理一起安装 libwebp。这是我的配置文件。请注意,没有特殊的 --with 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。