简体   繁体   English

PHP的Imagick无法打开图像

[英]Imagick in PHP unable to open image

I am trying to make a simple gradient in Imagick. 我正在尝试在Imagick中进行简单的渐变。

$im = new Imagick;

$im->newPseudoImage(279, 99, 'gradient:rgba(251, 215, 176, 1)-rgba(231, 195, 156, 1)');

I am getting this error message 我收到此错误消息

unable to open image `rgba(251, 215, 176, 1)-rgba(231, 195, 156, 1)': No such file or directory @ error/blob.c/OpenBlob/2642

I am running PHP 5.6.11 on IIS 7.5 in Windows 10. Did install Imagick from http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/ 我在Windows 10的IIS 7.5上运行PHP 5.6.11,是否从http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/安装了Imagick

I figured it out! 我想到了! Imagick has the most complicated installation process I have ever seen. Imagick具有我见过的最复杂的安装过程。

I went here and downloaded ImageMagick-6.8.8-10-Q16-x86-dll.exe. 我去这里下载了ImageMagick-6.8.8-10-Q16-x86-dll.exe。 I installed it to my computer. 我将其安装到计算机上。

Then I went to the installation folder and did two things: 然后,我进入安装文件夹并做了两件事:

  1. I copied all .dll - files from the root folder of the installation into the root folder of my php installation 我将所有.dll文件从安装的根文件夹复制到了php安装的根文件夹中
  2. I went into #ROOT_OF_IMAGICK_INSTALLATION#/modules/coders/ and copied all files from there into the root folder of my php installation. 我进入#ROOT_OF_IMAGICK_INSTALLATION#/ modules / coders /,并将所有文件从那里复制到我的php安装的根文件夹中。 One of these modules was "IM_MOD_RL_gradient_.dll" 这些模块之一是“ IM_MOD_RL_gradient_.dll”

And then, it works for me. 然后,它对我有用。 Hopefully someone else will be helped by this solution. 希望此解决方案可以帮助其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM