Closed
Bug 1366299
Opened 8 years ago
Closed 8 years ago
Canvas's drawImage method fails for data-uri base64-ed SVG
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 700533
People
(Reporter: dev.coding, Unassigned)
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170518000419
Steps to reproduce:
I make a base64 encoded SVG, put it in a data URI, and load that in a img tag element. I then draw this img tag element in a canvas.
Actual results:
Nothing is printed on canvas
Expected results:
The SVG should be printed on it, like Opera does
Seeing #589558 I thought it would work, but it actually doesn't... So maybe I'm making a **** Friday-afternoon mistake in that sample (but then why would it work on Opera?), or there is another underlying bug here.
Comment 1•8 years ago
|
||
Hi CJ,
Do you have any idea about this problem?
Flags: needinfo?(cku)
Priority: -- → P3
Whiteboard: [gfx-noted]
Reporter | ||
Comment 2•8 years ago
|
||
I though about one thing: may printing a SVG into a canvas be used to know whether you've visited a link? Like, you put a "a" tag in the SVG, add some styling to fill it in red if the link was visited, then you print it on a canvas, and use a javascript to get a SVG pixel color which will tell you whether it was visited?
I don't think this could be possible in my attached example, but maybe that's something that could be possible with another testcase.
Still, I would say that forbidding printing a SVG in a canvas just because of this issue may be a bit too drastic.
![]() |
||
Comment 3•8 years ago
|
||
Adding width and height attribute for SVG element seems to fix the problem.
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•