php5-imagick on Ubuntu 14.04 - php

I've spent quite some time googling for this issue, but to no avail, so I was hoping to get some help out here.
I'm using Ubuntu 14.04 and I've installed php5-imagick, ImageMagick and some extra libs for it to function. Testing the installation from the command line works perfectly and all delegates are installed according to 'convert -list configure' (output shown below).
It was working and performing perfectly before. The only thing I can think of is some system/security updates of Ubuntu. My code nor the IM installation were changed by any user actions before this error showed up.
The problem is when I call Imagick from my PHP script, it shows this error:
#420: no decode delegate for this image format '/' # error/constitute.c/ReadImage/544
This error is shown for both JPG and PNG.
Any help is greatly appreciated!
Output of 'convert -version':
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Output of 'convert -list configure':
DELEGATES bzlib djvu fftw fontconfig freetype jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
LIBS -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -llqr-1 -lglib-2.0 -lfftw3 -lfontconfig -lfreetype -lXext -lSM -lICE -lX11 -lXt -llzma -lbz2 -lz -lm -lgomp -lpthread -lltdl

I think the problem here is that Imagemagick isn't configured to support SVG. Installing basic php5-imagick package doesn't bring in some extras which you'll need for doing this.
To install support for SVG in PHP Imagick type the following into a terminal on the server in question:
sudo apt-get update
sudo apt-get install libmagickcore5-extra
Apt will list a load of dependent packages, including SVG libraries, and will ask you if you'd like to continue. Press Y and let it get on with it.

It appears that you're trying to open the file named '/'.
Strangely enough Imagick is not able to open that file.
Try passing in a real image filename.

Check the file to be processed with the vim command. Probably not an image.
I had a similar problem. You can see it here:
ImageMagick on Ubuntu 14.04 No decode delegate

Related

Imagick unable to open module file

I'm trying to use Imagick with PHP. I have installed the program, replaced the core dll files, loaded the dll extension with xampp, but now I get this error:
unable to open module file
`C:\Users\sudom\AppData\Local\ImageMagick\IM_MOD_RL_png_.dll': No such
file or directory # warning/module.c/GetMagickModulePath/830
This is the line causing the problem: $image->setImageFormat('png');.
I took a look to the AppData/Local folder, but there's no ImageMagick folder. If I place it there manually, it throws another error.
I use:
ImageMagick-7.0.7-11-Q16-x86-dll
php_imagick-3.4.3-7.1-ts-vc14-x86
Downlod the latest version from here
https://www.imagemagick.org/script/download.php
ImageMagick-7.0.7-12-Q16-x64-dll.exe
or
ImageMagick-7.0.7-12-Q16-x86-dll.exe
install, make sure adding the Imagick folder to the system PATH.
Optionally you can tick legacy utilities (convert, mogrify) during installation. and check in cmd 'magick -version'
c:\convert --version Version: ImageMagick 7.0.7-12 Q16 x64 2017-11-29
http://www.imagemagick.org Copyright: Copyright (C) 1999-2015
ImageMagick Studio LLC License:
http://www.imagemagick.org/script/license.php Visual C++: 180040629
Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib cairo
flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps
raw rsvg tiff webp xml zlib
Download php_imagick.dll from https://pecl.php.net/package/imagick/3.4.3/windows
meets your php version requirments, put in to ext folder of php and add it to php.ini file.
extension=php_imagick.dll
Than, go to http://windows.php.net/downloads/pecl/deps/
find needed version
3/27/2016 5:32 PM 32707238 ImageMagick-6.9.3-7-vc11-x64.zip
3/27/2016 5:33 PM 31517070 ImageMagick-6.9.3-7-vc11-x86.zip
3/27/2016 5:34 PM 38717224 ImageMagick-6.9.3-7-vc14-x64.zip
3/27/2016 5:34 PM 37376244 ImageMagick-6.9.3-7-vc14-x86.zip
download package and put all the DLLs files from ImageMagick-6.9.3-7-vc1x-xxx.zip\bin\ except ImageMagickObject.dll to ...\apache\bin\ and restart the apache service.
MUST WORK!
P.S. You can also find all the stuff from mentioned above resources for PHP 7.2 except pecl library. Need to wait for a while.

Imagemagick tiff installed and working but php Imagick extension supports no tiff

I'm running xampp on macOS (10.12.6) and installed Imagemagick (ImageMagick 7.0.7-3 Q16 x86_64 2017-09-19 ).
With the installed php Imagick extension, I can convert in php images from jpeg to png without problems.
But when I want to convert from tiff to png/jpeg, it doesnt work with the Imagick extension. But it works in terminal and the Imagemagick tiff DELEGATE is supported.
When I look at phpinfo(), there's no tiff support listed.
the PHP error is:
Uncaught ImagickException: unable to load module
'/usr/local/Cellar/imagemagick/7.0.7-3/lib/ImageMagick//modules-Q16HDRI/coders/tiff.la':
file not found # error/module.c/OpenModule/1270
Is the problem the double-backslash in the path?
When I navigate in the finder to the path with doubleback-backslash removed, there is the correct file.
I found the solution among the answers to issue #3919 for Homebrew on GitHub.
Try recompiling php-imagick71 and imagemagick one or several times in different order.
brew reinstall -s php-imagick71
brew reinstall -s imagemagick

ImageMagick No decode delegate for this image format

I work under windows and wamp server.
this is my PHP code with Imagick
$imagick = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/' . $this->_name);
where $_SERVER['DOCUMENT_ROOT'].'/'.$this->_name displays :
D:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG
I checked that image and it does exist in the folder.
But Imagick throws an exception :
Uncaught exception 'ImagickException' with message 'no decode delegate
for this image format
`D:/Sources/my_project/public/media/2/9/1/05201502/55450b10d8ea705201502_9.PNG'
# error/constitute.c/ReadImage/555' in
D:\Sources\my_project\library\project\Image.php on line 225
I looked for a solution, but didn't find any, how can I fix this?? thank you
Update: This is the result when I type convert -version in the command line :
Version: ImageMagick 6.8.8-4 Q16 x86 2014-01-29 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo \
png ps rsv g tiff webp xml zlib
update
This is the phpinfo of imagick.
ImageMagick number of supported formats: 0
ImageMagick supported formats: no value
Seems that your ImageMagick PHP module does not support any image formats.
Try to find other ImageMagick installation or install PHP from the scratch.
Also - seems that there is already question/answer in SO about that
You should run
convert -version
and report the output. On my system it is
Version: ImageMagick 6.9.0-0 Q16 x86_64 2014-12-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig \
jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps \
rsvg tiff webp wmf x xml zlib
Does your output include png as one of the built-in 'delegates'?
If not, update your installation, or build from current sources.
Finally I found solution for my windows openserver/nginx/php-fpm installation:
Download latest php_imagick distributive for your version of PHP from http://windows.php.net/downloads/pecl/releases/imagick/ (e.g. php_imagick-3.4.3-7.1-ts-vc14-x64.zip)
Extract only php_imagick.dll from this archive to your "php/ext" folder.
Run phpinfo() and check value at line "Imagick compiled with ImageMagick version" (mine was: "ImageMagick 6.9.3-7 Q16 x64 ...").
Now go to http://windows.php.net/downloads/pecl/deps/ and download correct version of Imagick-*.zip file (mine was: ImageMagick-6.9.3-7-vc14-x64.zip).
Extact this archive and copy all *.dll files from "/bin" folder to yout "php/ext" folder (about 145 files).
Restart server and check phpinfo(). ImageMagick now supports about 230+ formats.
Sometimes phpinfo() displays that imagick supports all formats, but php scripts are not respond - in this case double check that you download correct version of Imagick-*.zip for your installations. (ts/nts, VC11/VC14, x64/x86)

Unable to work on ImageMagick properly on Windows xampp

I read all the questions before posting this .
I am trying to install ImageMagick on my local system Windows 7.It gets installed without But when i try using it to crop images I get NoDecodeDelegateForThisImageFormat .
I am running Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
This is what i did
I installed ImageMagick ImageMagick-6.8.9-8-Q16-x86-dll.exe (I tried 6.8.1 and 6.7 also)
I got the dll from http://pecl.php.net/package/imagick/3.1.2/windows TS for PHP 5.4
Updated php.ini
The server started with out problem .
I checked via cmd the ImageMagick is working fine.
phpinfo() ImageMagick number of supported formats: 0
I tried many DLL's but none is working i need a solution to this .
Also phpinfo keeps on showing ImageMagick version:ImageMagick 6.8.8-4 Q16 x86 2014-01-29 even when i uninstalled it / updated it .
identify -version
Version: ImageMagick 6.8.9-8 Q16 x86 2014-08-26 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo png ps rsv
g tiff webp xml zlib
I am trying to open Jpg.
ImageMagick inside php is a really different from the standalone cmd version.
So, you need not only the php_imagic.dll connected to your php.ini.
But also the CORE_RL_*_.dll files in the Apache bin directory.
This will enable the readers.
Now you need the ENcoders. These are obtained from the standalone installation and located in [ImageMagick install dir]\modules\coders. Copy them to Apache's bin directory as well.
Now check the phpinfo();
The downside of this is that you need to match dll's from Standalone version to the one that is Compiled in the php-extension.

No formats supported in PHP/ImageMagik/imagick

I've installed pecl-imagick from FreeBSD ports and it can't do a thing with images.
phpinfo() reports this:
ImageMagick number of supported formats: 0
ImageMagick supported formats: no value
But ImageMagick installed correctly and show all it's stuff:
$ convert -list configure
...
DELEGATES bzlib fftw fontconfig jpeg jng lzma png zlib
...
What could be wrong and how to fix it?
I found that having an extension for GraphicsMagick (a "better" fork) installed causes that.
If you don't feel how it makes any sense, I'm totally with you.
Did you install PHP from ports? Update your ports and re-install packages.

Categories