-
Notifications
You must be signed in to change notification settings - Fork 37
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
Black background when converting SVG to PNG #34
Comments
Hi ,have you solved this problem? @giancarlobastos |
Some input on this: I believe this is due to oksvg not supporting Edit: I've looked at @giancarlobastos SVG and it also uses a |
I've perused the code and I've found something that confuses me:
Line 61 in a61f04f
endElement for the style tag is found, its text content is parsed and added to the styles here Line 89 in a61f04f
But before the Line 57 in a61f04f
style tags are not handled there and not a valid draw function, so this line will fail Line 345 in a61f04f
I'm not that far into the code, so I'm not sure enough on how to fix this to provide a PR. However, my intuition is to handle |
One more update from me (sorry for the multipost): After looking at the tests I realize that the |
Yes, I see no reason why that should be mandatory if it is not in the
specifications.
…On Fri, Aug 12, 2022 at 1:11 AM Hannes Leutloff ***@***.***> wrote:
One more update from me (sorry for the multipost):
After looking at the tests I realize that the style tag *is* supported,
but only within an enclosing defs tag. That is understandable, but is
probably not how most SVGs look and as far as I know there is nothing in
the SVG spec that says that style tags need to be enclosed in defs tags.
@srwiley <https://github.com/srwiley> would you be fine with changing
this requirement?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4VOB3QIOHGW6LNNM7MKT3VYYBMBANCNFSM5IL4JHIQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
That is great to hear. Would you mind taking a look at my PR then? |
@srwiley To me the solution that @yeldiRium came up with looks pretty good. Is there a chance that the according PR gets merged soon? |
Yes, is everyone in agreement? Have the tests been run and are there tests
supporting the new code?
…On Thu, Sep 1, 2022 at 7:52 AM Golo Roden ***@***.***> wrote:
@srwiley <https://github.com/srwiley> To me the solution that @yeldiRium
<https://github.com/yeldiRium> came up with looks pretty good. Is there a
chance that the according PR gets merged soon?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4VOBYIY6TER3LWRNGYOCTV4C7MNANCNFSM5IL4JHIQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, there are tests to support the code (and given the discussion above it seems as if @yeldiRium did a pretty decent job 😊). |
I'm trying to convert a
svg
file topng
, but the output file ended with a black background instead of white.SVG file: https://s.glbimg.com/es/sde/f/organizacoes/2020/02/12/botsvg.svg
PNG output:
The text was updated successfully, but these errors were encountered: