Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209457

[WebView] Canvas.toDataURL with image/jpeg MIME type fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: openjfx11
    • Fix Version/s: openjfx12
    • Component/s: javafx
    • Labels:
    • Subcomponent:
      web
    • Introduced In Build:
      b20

      Backports

        Description

        Load the following snippet into HelloWebView, it must render |green|red| rectangle.

        https://jsbin.com/raqizibeku/edit?html,output

        <body>
        <img id="canvas-to-data"/>
        <script>
        canvas = document.createElement('canvas');
        canvas.width=100;
        canvas.height=100;
        var ctx = canvas.getContext('2d');
        ctx.fillStyle = 'green';
        ctx.fillRect(0, 0, 50, 100);
        ctx.fillStyle = 'red';
        ctx.fillRect(50, 0, 50, 100);
        data = canvas.toDataURL("image/jpeg");
        document.getElementById('canvas-to-data').src = data;
        </script>
        </body>

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  arajkumar Arunprasad Rajkumar
                  Reporter:
                  arajkumar Arunprasad Rajkumar
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: