photoprism/mediafile_exif_test.go

33 lines
610 B
Go
Raw Normal View History

2018-02-04 17:34:07 +01:00
package photoprism
import (
"github.com/stretchr/testify/assert"
2018-02-28 10:08:49 +01:00
"testing"
2018-02-04 17:34:07 +01:00
)
func TestMediaFile_GetExifData(t *testing.T) {
conf := NewTestConfig()
2018-02-04 17:34:07 +01:00
conf.InitializeTestData(t)
2018-02-04 17:34:07 +01:00
image1 := NewMediaFile(conf.ImportPath + "/iphone/IMG_6788.JPG")
2018-02-04 17:34:07 +01:00
info, err := image1.GetExifData()
2018-02-04 17:34:07 +01:00
2018-02-28 10:08:49 +01:00
assert.Empty(t, err)
2018-02-04 17:34:07 +01:00
assert.IsType(t, &ExifData{}, info)
2018-02-04 17:34:07 +01:00
assert.Equal(t, "iPhone SE", info.CameraModel)
2018-02-04 17:34:07 +01:00
image2 := NewMediaFile(conf.ImportPath + "/raw/IMG_1435.CR2")
2018-02-04 17:34:07 +01:00
info, err = image2.GetExifData()
2018-02-04 17:34:07 +01:00
assert.Empty(t, err)
2018-02-04 17:34:07 +01:00
assert.IsType(t, &ExifData{}, info)
2018-02-04 17:34:07 +01:00
assert.Equal(t, "Canon EOS M10", info.CameraModel)
}