'Imagick fail in render <image />

I have this image in my file system
https://bdsmfetishitalia.pescarashibari.it/tor/image/tavoli/tavolo_93.svg
And I'm trying to convert it in jpg [ or png ] with this code

  $filename = 'https://bdsmfetishitalia.pescarashibari.it/tor/image/tavoli/tavolo_93.svg';
  $svgdata = file_get_contents($filename);

  $im = new \Imagick();
  $im->readImageBlob($svgdata);
  $im->setImageFormat("png32"); // $im->setImageFormat("jpg");

  $raw_data = $im->getImageBlob();
  file_put_contents('image/tavoli/tavolo_93.png', $raw_data);

But my result is this one
https://bdsmfetishitalia.pescarashibari.it/tor/image/tavoli/tavolo_93.png

The black table is the only visible object and the image are ignored. How can I have the tags in the converted file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source