Backend: Add info to metadata logs
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
4721f9d044
commit
636b56008b
@ -61,7 +61,7 @@ func (data *Data) Exif(fileName string) (err error) {
|
||||
if err.Error() == "no exif header" {
|
||||
return fmt.Errorf("metadata: no exif header in %s", txt.Quote(filepath.Base(fileName)))
|
||||
} else {
|
||||
log.Warnf("metadata: %s in %s", err, txt.Quote(filepath.Base(fileName)))
|
||||
log.Warnf("metadata: %s in %s (parse jpeg)", err, txt.Quote(filepath.Base(fileName)))
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
@ -81,7 +81,7 @@ func (data *Data) Exif(fileName string) (err error) {
|
||||
if err.Error() == "file does not have EXIF" {
|
||||
return fmt.Errorf("metadata: no exif header in %s", txt.Quote(filepath.Base(fileName)))
|
||||
} else {
|
||||
log.Warnf("metadata: %s in %s", err, txt.Quote(filepath.Base(fileName)))
|
||||
log.Warnf("metadata: %s in %s (parse png)", err, txt.Quote(filepath.Base(fileName)))
|
||||
}
|
||||
} else {
|
||||
parsed = true
|
||||
@ -95,7 +95,7 @@ func (data *Data) Exif(fileName string) (err error) {
|
||||
rawExif, err = exif.SearchFileAndExtractExif(fileName)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("metadata: no exif header in %s", txt.Quote(filepath.Base(fileName)))
|
||||
return fmt.Errorf("metadata: no exif header in %s (search and extract)", txt.Quote(filepath.Base(fileName)))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ func TestExif(t *testing.T) {
|
||||
t.Fatal("err should NOT be nil")
|
||||
}
|
||||
|
||||
assert.Equal(t, "metadata: no exif header in no-exif-data.jpg", err.Error())
|
||||
assert.Equal(t, "metadata: no exif header in no-exif-data.jpg (search and extract)", err.Error())
|
||||
})
|
||||
|
||||
t.Run("screenshot.png", func(t *testing.T) {
|
||||
@ -264,6 +264,6 @@ func TestExif(t *testing.T) {
|
||||
t.Run("gopher-preview.jpg", func(t *testing.T) {
|
||||
_, err := Exif("testdata/gopher-preview.jpg")
|
||||
|
||||
assert.EqualError(t, err, "metadata: no exif header in gopher-preview.jpg")
|
||||
assert.EqualError(t, err, "metadata: no exif header in gopher-preview.jpg (search and extract)")
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user