title: Cropping not working on rotated images javascript
body: <p>I am trying to crop an image after rotation , but unfortunately the crop is being done on original image instead of rotated image.
  I am using open cv . Here is my code for rotation - </p>
  
  <pre><code> rotateImage(event) {
  var sampleimage = document.getElementById("sample");
  console.log(sampleimage.height);
  var scope = this;
  
  if (event.target.id === "rotateC") {
    rotate = rotate + 90;
    // sampleimage.style.transform = "rotate(" + rotate + "deg)";
    scope.imageRotate();
  }
  
  if (event.target.id === "rotateA") {
    rotate = rotate - 90;
    sampleimage.style.transform = "rotate(" + rotate + "deg)";
  }}
  </code></pre>
  
  <p>Is there a simple solution for the same. Any help will be appreciated.</p>