exif.RegisterParsers() should only be called once

This commit is contained in:
Michael Mayer 2019-05-12 09:44:20 +02:00
parent a612609854
commit 1125ba2da4

View file

@ -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 {