ImageScript icon indicating copy to clipboard operation
ImageScript copied to clipboard

Image rotation doesn't maintain height and width

Open Agrejus opened this issue 1 year ago • 0 comments

Describe the bug When an image is rotated the height and width are not changed. For example, if we have an image with an orientation of 6, we need to rotate it 90 degrees to be viewed properly. When calling .rotate(270) on the image, black bars are added to the left and right of the image to maintain the original height and width. Rotating the image 90 degrees causes the height and width to be swapped, but it looks like the height and width are not swapped causing black bars on either side of the image.

Original Image: IMG_0156 - Copy (2) (1).jpeg IMG_0156 - Copy (2) (1).jpeg

Resulting Bug: Bug.jpeg bug.jpeg

To Reproduce Steps to reproduce the behavior:

  1. Load attached image (IMG_0156 - Copy (2) (1).jpeg)
  2. Rotate image 270 degrees
  3. encode to JPEG
  4. View result

Expected behavior I expect the image to be rotated and the height and width to be swapped because we rotated the image 90 degrees

Screenshots See attached images for before and after

Platform:

  • OS: Windows 10
  • Environment: Chrome
  • Version: 1.2.16

Additional context Add any other context about the problem here.

Agrejus avatar Jun 13 '23 20:06 Agrejus