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:
Emre
2026-08-28 12:16:52 -04:00
parent bd62fa12fd
commit 70c4ea0d54
+1 -1
View File
@@ -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
}