I'm trying to create an jpg with Imagick but I have an error in readImageBlob
$image = new \Imagick();
$chart = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $chart;
$image->readImageBlob( $chart );
$image->setImageFormat("jpeg");
It says:
negative or zero image size `/tmp/magick-29893mIHq2qQrLKKP' @ error/image.c/SetImageExtent/2601
Pointing to the line that I mentioned before. I have previously defined $chart
as:
$chart = '<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="highcharts-root" style="font-family:"lucida grande", "lucida sans unicode", arial, helvetica, sans-serif;font-size:12px;" xmlns="http://... (ETC) ...g></svg>';
Could be a problem with how is $chart
defined?
What and how should I look for $chart
in order to see if is correct defined or not?
The problem is reading a Blob, not converting a svg to a blob