Skip to content

Commit

Permalink
Merge pull request Kitware#1986 from EJShim/rectangle-image-to-imagedata
Browse files Browse the repository at this point in the history
Should be able to convert non-squared image into `vtkimagedata`
  • Loading branch information
jourdain authored Jul 9, 2021
2 parents 620cd1f + 34ba6d1 commit b1a9fe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Common/Core/ImageHelper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function imageToImageData(
ctx.translate(canvas.width / 2, canvas.height / 2);
ctx.scale(flipX ? -1 : 1, flipY ? -1 : 1);
ctx.rotate((rotate * Math.PI) / 180);
ctx.drawImage(image, -image.width / 2, -image.width / 2);
ctx.drawImage(image, -image.width / 2, -image.height / 2);

return canvasToImageData(canvas);
}
Expand Down

0 comments on commit b1a9fe4

Please sign in to comment.