mirror of
https://github.com/axllent/mailpit.git
synced 2025-01-22 03:39:59 +02:00
Chore: Auto-rotate thumbnail images based on exif data
This commit is contained in:
parent
7085690e3d
commit
96c33b1233
@ -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 (
|
||||
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user