mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-29 04:41:57 -04:00
auto orientate pictures for thumbnails
This commit is contained in:
6
changelog/unreleased/orientate-thumbnails.md
Normal file
6
changelog/unreleased/orientate-thumbnails.md
Normal 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
|
||||
@@ -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`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user