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

@@ -13,6 +13,7 @@ import (
"kitty/tools/utils/shm"
"github.com/disintegration/imaging"
"github.com/edwvee/exiffix"
)
var _ = fmt.Print
@@ -109,7 +110,7 @@ func scale_image(imgd *image_data) bool {
}
func load_one_frame_image(imgd *image_data, src *opened_input) (img image.Image, err error) {
img, err = imaging.Decode(src.file, imaging.AutoOrientation(true))
img, _, err = exiffix.Decode(src.file)
src.Rewind()
if err != nil {
return