Home > Backend Development > PHP Tutorial > imagemagick - php ImagickException

imagemagick - php ImagickException

WBOY
Release: 2016-06-06 20:49:36
Original
1813 people have browsed it

extension_loaded('imagick') or die('imagick not loaded');

$image = new Imagick('../2.jpg');

$image->readImageBlob($image);

我在本地执行这段代码 提示这个错误

PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `/var/tmp/magick-97177Oi2u6P8XJCjE' @ error/constitute.c/ReadImage/552' in /Users/test/img/img.php:4 Stack trace:

0 /Users/test/img/img.php(4): Imagick->__construct('../2.jpg')

1 {main}

thrown in /Users/test/img/img.php on line 4

我的 Imagick 已经安装了

imagemagick - php ImagickException

请各位帮忙看看是什么问题

回复内容:

extension_loaded('imagick') or die('imagick not loaded');

$image = new Imagick('../2.jpg');

$image->readImageBlob($image);

我在本地执行这段代码 提示这个错误

PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `/var/tmp/magick-97177Oi2u6P8XJCjE' @ error/constitute.c/ReadImage/552' in /Users/test/img/img.php:4 Stack trace:

0 /Users/test/img/img.php(4): Imagick->__construct('../2.jpg')

1 {main}

thrown in /Users/test/img/img.php on line 4

我的 Imagick 已经安装了

imagemagick - php ImagickException

请各位帮忙看看是什么问题

ImageMagick报错说“no decode delegate for this image format”的意思就是,你装了ImageMagick,但你装的ImageMagick无法解码你要打开的文件(JPEG)

注意看你截图里的"ImageMagick supported formats",里面没有JPEG

我想大概是你配置安装ImageMagick时没有加'--with-jpeg=yes吧……

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template