mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-11 13:28:57 +00:00
fix(thumbnail): fixes thumbnail rotation issues
Adding `imaging.AutoOrientation(true)` ensures that the image is decoded in the correct orientation based on the EXIF data without making assumptions. Manually verified the fix after the change and confirmed that it's working as expected Fixes #538
This commit is contained in:
@@ -68,7 +68,7 @@ func GetDimensions(r io.Reader) (int, int, error) {
|
||||
// CreateThumb generates a thumbnail of the given image file with the specified maximum dimension.
|
||||
// The thumbnail's width will be resized to `thumbPxSize` while maintaining the aspect ratio.
|
||||
func CreateThumb(thumbPxSize int, r io.Reader) (*bytes.Reader, error) {
|
||||
img, err := imaging.Decode(r)
|
||||
img, err := imaging.Decode(r, imaging.AutoOrientation(true))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user