-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
SVG in img tag not rendering correctly in Firefox #1897
Comments
Just following up on this issue... any insight? Is there more information or samples that I could provide? |
sponce
pushed a commit
to HSF/phoenix
that referenced
this issue
Jan 12, 2023
This is a workaround to a bug in html2canvas where svg files with no width/height attributes are not rendered properly, at least under firefox. See niklasvh/html2canvas#1897
This was referenced Jan 12, 2023
I've actually got the same problem recently and I've now tried to fix it in #3018. The fix still has a timing issue that I do not manage to fix for the moment. Do not hesitate to have a look. |
sponce
pushed a commit
to HSF/phoenix
that referenced
this issue
Jan 16, 2023
This is a workaround to a bug in html2canvas where svg files with no width/height attributes are not rendered properly, at least under firefox. See niklasvh/html2canvas#1897
sponce
pushed a commit
to HSF/phoenix
that referenced
this issue
Jan 16, 2023
This is a workaround to a bug in html2canvas where svg files with no width/height attributes are not rendered properly, at least under firefox. See niklasvh/html2canvas#1897
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please make sure you are testing with the latest release of html2canvas.
Old versions are not supported and issues reported for them will be closed.
Please follow the general troubleshooting steps first:
Bug reports:
I am trying to use html2canvas to generate an image from a page that contains an SVG in the form of a base-64 encoded data URI in an
<img>
tag. This has been working fine in Chrome but not in Firefox. I think this may be because Firefox is returning 0 for bothimg.naturalWidth
andimg.naturalHeight
which as used as theintrinsicWidth
andintrinsicHeight
values in theImageElementContainer
class. The SVG haswidth
andheight
attributes set. Could theintrinsicWidth
andintrinsicHeight
values be derived from the<svg>
'swidth
andheight
instead of the<img>
'snaturalWidth
andnaturalHeight
?I don't have an example I can easily provide but I can create a jsfiddle if needed.
Specifications:
The text was updated successfully, but these errors were encountered: