Skip to content

Commit

Permalink
Chore: Auto-rotate thumbnail images based on exif data
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Apr 18, 2024
1 parent 7085690 commit 96c33b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/apiv1/thumbnails.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/axllent/mailpit/internal/logger"
"github.com/axllent/mailpit/internal/storage"
"github.com/kovidgoyal/imaging"
"github.com/gorilla/mux"
"github.com/jhillyerd/enmime"
"github.com/kovidgoyal/imaging"
)

var (
Expand Down Expand Up @@ -74,7 +74,7 @@ func Thumbnail(w http.ResponseWriter, r *http.Request) {

buf := bytes.NewBuffer(a.Content)

img, err := imaging.Decode(buf)
img, err := imaging.Decode(buf, imaging.AutoOrientation(true))
if err != nil {
// it's not an image, return default
logger.Log().Warnf("[image] %s", err.Error())
Expand Down

0 comments on commit 96c33b1

Please sign in to comment.