我是使用ImageMagick
. 我有一个svg
来自文件系统的简单图像,我想将它转换为png
文件,所以我运行:
$ convert -resize 100% ~/image.svg ~/image.png
错误是:
convert-im6.q16: non-conforming drawing primitive definition `px' @ error/draw.c/DrawImage/3265.
我的image.svg
:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; cursor: grab;" viewBox="-490 -155 1311 669">
<g stroke="#000" class="item" style="stroke-width: 3px; stroke-linecap: round;">
<rect x="273" y="149" width="126" height="111" stroke="transparent" fill="none" style="stroke-width: 30px;"></rect>
<rect x="273" y="149" width="126" height="111" fill="none"></rect>
</g>
<g stroke="#000" class="item" style="stroke-width: 3px; stroke-linecap: round;">
<ellipse cx="-167.5" cy="97.5" rx="209.5" ry="206.5" stroke="transparent" fill="none" style="stroke-dasharray: 5px, 5px; stroke-width: 30px;"></ellipse>
<ellipse cx="-167.5" cy="97.5" rx="209.5" ry="206.5" fill="none"></ellipse>
</g>
</svg>
我的ImageMagick
版本:
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
我的rsvg-convert
版本:
rsvg-convert version 2.40.20