Add image.Exif

Note that we will probably need to add some metadata cache for this to scale.

Fixes #4600
This commit is contained in:
Bjørn Erik Pedersen
2019-08-29 10:18:51 +02:00
parent 8a8d4a6d97
commit 28143397d6
12 changed files with 483 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import (
"sync"
"github.com/disintegration/gift"
"github.com/gohugoio/hugo/resources/images/exif"
"github.com/spf13/afero"
bp "github.com/gohugoio/hugo/bufferpool"
@@ -181,6 +182,10 @@ func (r *resourceAdapter) Height() int {
return r.getImageOps().Height()
}
func (r *resourceAdapter) Exif() (*exif.Exif, error) {
return r.getImageOps().Exif()
}
func (r *resourceAdapter) Key() string {
r.init(false, false)
return r.target.(resource.Identifier).Key()