tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

imageBitmap-from-imageData-no-image-rotation.html (752B)


      1 <html>
      2  <link rel="match" href="imageBitmap-from-imageData-no-image-rotation-expected.html" />
      3  <style type="text/css">
      4    canvas {
      5      image-orientation: none;
      6    }
      7  </style>
      8 <body>
      9  <canvas id="myCanvas" width="400" height="400"></canvas>
     10 </body>>
     11 <script>
     12 var canvas = document.getElementById('myCanvas');
     13 ctx = canvas.getContext('2d');
     14 image = document.createElement("img");
     15 image.src = "../../../resources/black_white.png"
     16 image.onload = function() {
     17  Promise.all([
     18    // The image should be flipped and ignoring "image-orientation" setting
     19    // in css style.
     20    createImageBitmap(image, { imageOrientation: 'flipY' }),
     21    ]).then(function(sprites) {
     22  // Draw image onto the canvas
     23  ctx.drawImage(sprites[0], 0, 0);
     24 });
     25 }
     26 </script>