I want to convert SVG to JPG, according to Convert SVG image to PNG with PHP I've created conversion method
public static function createJpgFromSvg($src, $dst, $w = 320, $h = 240) {
$im = new \Imagick();
$svg = file_get_contents($src);
$im->readImageBlob($svg);
$im->setImageFormat("jpeg");
$im->adaptiveResizeImage($w, $h);
$im->writeImage($dst);
$im->clear();
$im->destroy();
}
Problem is that I always receive an exception:
ImagickException #1
unable to open image `<path>': No such file or directory @ error/blob.c/OpenBlob/2675
For line:
$im->writeImage($dst);
I've already checked write rights on the destination folder and I have 777. Could you help me?