| Server IP : 23.254.227.96 / Your IP : 216.73.216.21 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/local/src/imagick/tests/ |
Upload File : |
--TEST--
Test Tutorial, svgExample
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
function svgExample() {
$svg = <<< END
<?xml version="1.0"?>
<svg version='1.0' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='746' height='742' viewBox='-362 -388 746 742' encoding='UTF-8' standalone='no'>
<defs>
<ellipse id='ellipse' cx='36' cy='-56' rx='160' ry='320' />
<g id='ellipses'>
<use xlink:href='#ellipse' fill='#0000ff' />
<use xlink:href='#ellipse' fill='#0099ff' transform='rotate(72)' />
</g>
</defs>
</svg>
END;
$svg = '<?xml version="1.0"?>
<svg width="120" height="120"
viewPort="0 0 120 120" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="myClip">
<circle cx="30" cy="30" r="20"/>
<circle cx="70" cy="70" r="20"/>
</clipPath>
</defs>
<rect x="10" y="10" width="100" height="100"
clip-path="url(#myClip)"/>
</svg>';
$image = new \Imagick();
$image->readImageBlob($svg);
$image->setImageFormat("jpg");
$bytes = $image;
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
}
svgExample() ;
echo "Ok";
?>
--EXPECTF--
Ok