[Webkit-unassigned] [Bug 159340] New: Drawing an <img> with an SVG source into a <canvas> has incorrect rendering if the SVG viewBox does not match the <img> metrics

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 1 02:47:44 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=159340

            Bug ID: 159340
           Summary: Drawing an <img> with an SVG source into a <canvas>
                    has incorrect rendering if the SVG viewBox does not
                    match the <img> metrics
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: graouts at webkit.org
                CC: webkit-bug-importer at group.apple.com,
                    zimmermann at kde.org

Created attachment 282532
  --> https://bugs.webkit.org/attachment.cgi?id=282532&action=review
Testcase

See the attached testcase. In it we have an SVG image which has viewBox="0 0 200 200" and a <circle> with its top left corner located at 40,40 and sized to be 120x120. That SVG image is set as the src of an <img> element which is sized to be 100x100 by calling new Image(100, 100). Then we draw the <img> into a <canvas> sized to be 200x200 with a call to drawImage(image, 20, 20, 60, 60, 0, 0, width, height). Since the SVG image is scaled to be 0.5x its intrinsic size, drawing from a source of 20,20 and 60x60 should be a perfect match for the circle metrics but the output doesn't match, except very rarely when the image draws correctly.

Chrome behaves the same as us and Firefox draws black only.

There was a recent source change to improve this with https://bugs.webkit.org/show_bug.cgi?id=159276, but it seems it doesn't quite cover all cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160701/bf2445be/attachment.html>


More information about the webkit-unassigned mailing list