成都网站建设设计

将想法与焦点和您一起共享

phpsvg怎么转jpg

本文操作环境:windows7系统、php7.1版、DELL G3电脑

php svg怎么转svg?

php imagick svg转成jpg

代码如下:

public function svgtojpg()
{
$image = '




';
$filename = 'ef.jpg';
/* $image = stripslashes($_POST['json']);
$filename = $_POST['filename'];*/
$unique = time();
$im = new \Imagick();
$im->readImageBlob($image);
$res = $im->getImageResolution();
$x_ratio = $res['x'] / $im->getImageWidth();
$y_ratio = $res['y'] / $im->getImageHeight();
$im->removeImage();
$im->setResolution($width_in_pixels * $x_ratio, $height_in_pixels * $y_ratio);
$im->readImageBlob($image);
$im->setImageFormat("jpeg");
$im->writeImage(__DIR__ . '/../../../Public/moban/images/1/humourised_'. $filename);
$im->clear();
$im->destroy();
}

网页题目:phpsvg怎么转jpg
浏览路径:http://chengdu.cdxwcx.cn/article/dhceshj.html