diff --git a/services/search/pkg/content/tika_photo.go b/services/search/pkg/content/tika_photo.go index 20798cc5fa..f2cecf90c1 100644 --- a/services/search/pkg/content/tika_photo.go +++ b/services/search/pkg/content/tika_photo.go @@ -40,7 +40,7 @@ func (t Tika) getPhoto(meta map[string][]string) *libregraph.Photo { } } - if v, err := getFirstValue(meta, "Base ISO"); err == nil { + if v, err := getFirstValue(meta, "exif:IsoSpeedRatings"); err == nil { if i, err := strconv.ParseInt(v, 0, 32); err == nil { initPhoto() photo.SetIso(int32(i)) diff --git a/services/search/pkg/content/tika_photo_test.go b/services/search/pkg/content/tika_photo_test.go index 9995d59587..c2357b6995 100644 --- a/services/search/pkg/content/tika_photo_test.go +++ b/services/search/pkg/content/tika_photo_test.go @@ -16,7 +16,7 @@ var _ = Describe("getPhoto", func() { "exif:ExposureTime": {"0.001"}, "exif:FNumber": {"1.8"}, "exif:FocalLength": {"50"}, - "Base ISO": {"100"}, + "exif:IsoSpeedRatings": {"100"}, "tiff:Orientation": {"1"}, "exif:DateTimeOriginal": {"2018-01-01T12:34:56"}, }) @@ -32,6 +32,16 @@ var _ = Describe("getPhoto", func() { Expect(photo.TakenDateTime).To(Equal(libregraph.PtrTime(time.Date(2018, 1, 1, 12, 34, 56, 0, time.UTC)))) }) + It("takes the iso of the shot, not the canon maker note base iso", func() { + photo := Tika{}.getPhoto(map[string][]string{ + "exif:IsoSpeedRatings": {"800"}, + "Base ISO": {"256"}, + "img:Base ISO": {"256"}, + }) + Expect(photo).ToNot(BeNil()) + Expect(photo.Iso).To(Equal(libregraph.PtrInt32(800))) + }) + It("returns nil when no photo metadata is present", func() { Expect(Tika{}.getPhoto(map[string][]string{})).To(BeNil()) })