canvas drawImage doesn't work with some svg HTMLImageElement
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: felipealexandref, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Steps to reproduce:
I try to draw a valid HTMLImageElement in a canvas (canvas.context("2d").drawImage method), whose src is a svg with no width and height properties.
http://jsfiddle.net/gjqc95f2/ (please open http version to see a valid example)
Actual results:
The same HTMLImageElement works in the page, but drawImage doesn't can draw this svg. However, If the svg has width and height attributes, then it works.
Workaround: dataurl as base64 seems to work.
Expected results:
The image should be drawn as in google chrome, and as the same image outside of canvas (as a dom element in the document)
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Description
•