exif.RegisterParsers() should only be called once
This commit is contained in:
parent
a612609854
commit
1125ba2da4
1 changed files with 4 additions and 2 deletions
|
@ -30,6 +30,10 @@ type ExifData struct {
|
|||
Orientation int
|
||||
}
|
||||
|
||||
func init() {
|
||||
exif.RegisterParsers(mknote.All...)
|
||||
}
|
||||
|
||||
// ExifData return ExifData given a single mediaFile.
|
||||
func (m *MediaFile) ExifData() (*ExifData, error) {
|
||||
if m == nil {
|
||||
|
@ -54,8 +58,6 @@ func (m *MediaFile) ExifData() (*ExifData, error) {
|
|||
|
||||
defer file.Close()
|
||||
|
||||
exif.RegisterParsers(mknote.All...)
|
||||
|
||||
x, err := exif.Decode(file)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue