Skip to content

Instantly share code, notes, and snippets.

@alinmigea
Last active September 28, 2020 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alinmigea/f7ea322237c9d0c1a4e3a670c84621e4 to your computer and use it in GitHub Desktop.
Save alinmigea/f7ea322237c9d0c1a4e3a670c84621e4 to your computer and use it in GitHub Desktop.
PHP: Use Imagick to convert SVG chart to PNG
Commands for installing the server library:
sudo apt-get install php7.0-imagick
sudo apt-get update
sudo service apache2 restart
Errors:
Caught exception: no decode delegate for this image format `' @ error/blob.c/BlobToImage/
use the following, because it might be that you don't have the MIME tyep SVG installed:
sudo apt-get install libgraphicsmagick1-dev libmagickcore-dev libmagickcore-6.q16-2 libmagickcore-6.q16-2-extra
identify -list format | grep SVG
Output: MSVG SVG rw+ ImageMagick's own SVG internal renderer
Usefull links:
https://stackoverflow.com/questions/13125352/readimageblob-fatal-error-when-converting-svg-into-png/15614469#15614469
https://github.com/gographics/imagick/issues/97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment