rsvg不会渲染链接的图像 [英] rsvg doesn't render linked images

查看:107
本文介绍了rsvg不会渲染链接的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用python rsvg绑定将svg图像渲染到开罗并保存到文件中,这通常可以正常工作.但是,如果svg文件包含链接的图像,则如下所示:

I use the python rsvg bindings to render an svg image into cairo and save to file, which mostly works. But if the svg file contains a linked image, like so:

<image href="static/usrimgs/tmpDtIKpx.png" x="10" y="10" width="600px" height="400px"></image>

图片未显示在最终文件中(其余的svg效果很好).根据脚本的运行位置,相对路径是正确的,但是我猜测它通常是一个相对URL,而不是相对文件路径,因此存在一些问题.我该如何解决?

the image doesn't show up in the final file (the rest of the svg renders just fine). The relative path is correct based on where the script is running, but I'm guessing there's some problem with the fact that it would normally be a relative URL, not a relative filepath. How do I get around this?

推荐答案

答案是处理链接以file:///开头并成为完整的绝对路径.

The answer was to process the links to start with file:/// and be a full absolute path.

这篇关于rsvg不会渲染链接的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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