-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded images using data URIs no longer work without unsafe flag #383
Comments
We also are experiencing this issue. We are seeing images in our production environment rendering without backgrounds because of it. @liZe perhaps related to your recent changes? |
@stefanvdlugt how were you able to get the unsafe flag to work? I got it to work via command line, but passing |
@joaniehollberg We haven't had the time to get this working yet. We are using the command line version, but we do not want to use the unsafe flag, since we only want to allow embedded resources. The release notes of the latest version state that it is also possible to change the |
Yes, accessing external resources has been disabled by default because it could lead to various security problems.
It should work. Internally, the CLI option only sets the
The
If, for some reason, you don’t trust the SVG content but still want to reach external resources, then the
We should allow data URLs, even without the |
We also ran into this issue using a cairosvg.svg2png(content, unsafe=True) |
This should be fixed now, tests are welcome! |
Since update 2.7.0, embedded images are ignored when converting SVG files without the
unsafe
flag.The images are embedded as base64:
As the description of the
unsafe
option states that it allows loading external files, we'd expect data URIs to still work. Is there an option to forbid loading external resources but allow including images using data URIs?The text was updated successfully, but these errors were encountered: