no decode delegate for this image format `PNG' ImageMagick CentOS - php

I'm trying to use ImageMagick in CentOS to generate pdf documents and convert PNG images. ImageMagic is already installed and imagic extension is loaded and working in PHP 5.5 but when I try to generate PDF or convert images I get the follow error:
no decode delegate for this image format `PNG'
I've already installed libpng and reinstalled ImageMagic but the problem continues

Related

How to upgrade the version of php-gd library when running from php-fpm at Ubuntu 16.04 server?

I've followed this tutorial to install and support PHP-5.6 at my ISPConfig3 server: https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/.
The installation is up and running, now I want to change the php-gd library version. PHP info actually reports:
GD Support enabled
GD Version bundled (2.1.0 compatible)
I need to use the following version:
GD Support enabled
GD headers Version 2.2.3
GD library Version 2.2.3
Why do i need to upgrade?
I'm facing problems when cropping images, but is only on this server. I've a similar server with PHP-5.6, without fpm, that is working fine. I realized the difference in versions after compare the phpinfo() reports from both servers
Expected Behavior
User uploads an image. The image can have any dimension. (eg: 1920x1080)
The script resizes the image. (eg: from 1920px to 1200px)
The resized image maintain it's original aspect ratio and should not be cropped.
See: http://imgur.com/MkMVg6x
The problem
User uploads an image. The image can have any dimension. (eg: 1920x1080)
The script SHOULD resize the image. (eg: from 1920px to 120px)
The final image was cropped erroneously :(
See: http://imgur.com/a/wT0Rh
Since i'm using php-fpm, how can i upgrade my GD library version?
After long hours digging, I finally found the problem, and as i expected, it's not related to GD library itself. It's related to phpThumb and imagemagick libraries.

imagick not converting webp format on Amazon Linux

imagick convert command is not working for this webp image -
https://lh3.googleusercontent.com/VRY0O_3L8VH2wxJSTiKPr72PeM5uhPPFEsHzzYdxenddpTI150M0TYpljnZisQaROR0=h256-rw -
convert -resize 50x50! https://lh3.googleusercontent.com/VRY0O_3L8VH2wxJSTiKPr72PeM5uhPPFEsHzzYdxenddpTI150M0TYpljnZisQaROR0=h256-rw /var/test_sandeepan/output.jpg
Output -
convert: no decode delegate for this image format `WEBP' # error/constitute.c/ReadImage/535.
From this, I conclude that webp is either not supported by Imagick at all, or not supported by this version.
A link shared in this answer, talks about webp support along with imagemagick and php, so I thought imagick must be supporting webp as well, because PHP imagemagick, as per my understanding is nothing but a wrapper class to the imagick utility. Please correct me if I am wrong here.
I conclude that webp is either not supported by Imagick at all, or not supported by this version.
Imagick doesn't really do anything. All it does is convert PHP function calls into C function calls, to call the ImageMagick code through its 'wand' API.
If you want to have ImageMagick support webp, you will either need to install a version that has been compiled with webp support compiled in, or compile it yourself: http://www.imagemagick.org/script/advanced-unix-installation.php
You'll need to install libwebp-devel either from apt/yum, or from https://github.com/webmproject/libwebp as ImageMagick relies on that 'delegate' code being there to read/write webp images.

ImageMagik Crop and GhostScript PHP v 5.3.13 and Apache v 2.3.33

I am trying to convert pdf file into jpeg image format using imagemagik crop and ghostscript.
I research a lot, but not getting any solution got so many links but my system compatiblity might be an issue.
My System is Win 7
PHP v 5.3.13
Apache v 2.3.33
wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-32b
I am not getting any proper link where i can find out dll file and make such changes in .dll file etc.
If all you want is a JPEG then you can use Ghostscript directly to produce it. I can't see any reason why you would want to change a DLL, which realistically you can only do by changing and recompiling the source.
Eg:
http://stackoverflow.com/questions/13812998/ghostscript-ps-to-jpg-output-without-white-space

Convert SVG to PNG with GD

I want to convert an SVG image to a PNG in PHP. I know how to do it in Imagemagick but I dont get it to work on my Webserver and it seems SVG support is not very good with imagemagick.
So how can I do it with GD and is SVG even supported?
Sadly, GD2 does not support SVG. I had to install a unix virtual machine and I am trying with Imagick, that supports SVG.

Converting JPG image to tiff file format

I am trying to convert a jpeg image to a tiff image, however unsuccessful in doing it using PHP. Kindly help me out with this issue.
The main thing is that the imagemagick and exec() system() and related commands are blocked by the my service provider.
So provide me solution which deosnt use imagick and command tools for conversion.
For this action you need to have Imagemagic installed on your server (it is installed by default on an average web server) after you have Imagemagic support do the following:
$command = "convert /path_to_file/filename.jpg /path_to_file/filename.tiff";
exec($command);
if you dont have imagemagic install it from here:
http://www.imagemagick.org/script/index.php

Categories