auto orientate pictures for thumbnails

This commit is contained in:
David Christofas
2022-09-05 16:33:29 +02:00
parent 29f52515e1
commit bff9c2b3cd
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
Enhancement: Automatically orientate photos when generating thumbnails
The thumbnailer now makes use of the exif orientation information to automatically orientate pictures before generating thumbnails.
https://github.com/owncloud/ocis/issues/4477
https://github.com/owncloud/ocis/pull/4513

View File

@@ -10,6 +10,7 @@ import (
"mime"
"strings"
"github.com/disintegration/imaging"
"github.com/pkg/errors"
"golang.org/x/image/font"
"golang.org/x/image/font/opentype"
@@ -23,7 +24,7 @@ type FileConverter interface {
type ImageDecoder struct{}
func (i ImageDecoder) Convert(r io.Reader) (interface{}, error) {
img, _, err := image.Decode(r)
img, err := imaging.Decode(r, imaging.AutoOrientation(true))
if err != nil {
return nil, errors.Wrap(err, `could not decode the image`)
}