Fixes #8317 Sharp based images are auto-oriented based on the EXIF data i.e. `.rotate()`. This can be problematic when resizing images as the `originalAspectRatio` calculation we do in the `imageResizer` can become incorrect if the files dimensions are rotated from sharp. For example, uploading an `ios` based image with dimensions of 3024 x 4032 will be auto rotated to 4032 x 3024 because the exif data gives the image an orientation of `6` - which means it needs to be rotated 90 degrees clockwise. As a result, the original aspect ratio goes from being `0.75` to `1.3333` - which is incorrect. This PR preserves the original aspect ratio to properly resize images based on the original dimensions - not the sharp based dimensions.
1.1 MiB
1.1 MiB