Use exiffix rather than imaging to handle EXIF rotation

exiffix works for more formats than just JPEG
This commit is contained in:
Kovid Goyal
2024-03-22 09:35:39 +05:30
parent 0eae7ba21d
commit e11081ac09
4 changed files with 10 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import (
"kitty/tools/utils/shm"
"github.com/disintegration/imaging"
"github.com/edwvee/exiffix"
"golang.org/x/exp/slices"
)
@@ -254,7 +255,7 @@ func OpenNativeImageFromReader(f io.ReadSeeker) (ans *ImageData, err error) {
return nil, err
}
} else {
img, err := imaging.Decode(f, imaging.AutoOrientation(true))
img, _, err := exiffix.Decode(f)
if err != nil {
return nil, err
}