ImageMagick将SVG转换为PNG,无法启用RSVG [英] ImageMagick convert SVG to PNG not working with RSVG enabled

查看:632
本文介绍了ImageMagick将SVG转换为PNG,无法启用RSVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ImageMagick的 convert 实用程序将SVG文件转换为PNG图像。起初,我在OSX上使用IM的vanilla安装( brew install imagemagick )来转换SVG:

I'm using ImageMagick's convert utility to convert SVG file to PNG image. At first, I used vanilla installation of IM on OSX (brew install imagemagick) to convert the SVG using:

$ convert file.svg file.png

除了该文件中的一些图像对象被偏移(实际链接到图像)。然后我阅读建议ImageMagick的相关问题使用 rsvg 支持进行编译(自制软件使用 brew install imagemagick --use-rsvg )。

This worked except that some of the image objects in that file were offset (actual links to images). I then read a related question that suggested ImageMagick to be compiled with rsvg support (homebrew does it with brew install imagemagick --use-rsvg).

现在,当我尝试执行转换时,不会渲染任何图像。我尝试使用此SVG文件,生成的PNG为空白。但是,如果SVG上存在任何文本,它将在适当的位置呈现。任何想法如何进行?谢谢。

Now, when I try to perform the conversion, no images are rendered. I tried using this SVG file, and the resulting PNG was blank. However, if any text exists on the SVG, it's rendered in the proper location. Any ideas how to proceed? thanks.

推荐答案

哦,我现在看看 SVG文件

它包含JavaScript。我不认为RSVGlib支持SVG内部的JavaScript。我肯定知道名为 MSVG 的内部SVG编码器没有。

It contains JavaScript. I do not think that the RSVGlib does support JavaScript inside SVGs. I know for sure that the internal SVG coder named MSVG does not.

这篇关于ImageMagick将SVG转换为PNG,无法启用RSVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆