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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • jfx12
    • jfx11
    • javafx
    • web
    • b20

        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>

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

                Created:
                Updated:
                Resolved: