diff --git a/internal/photoprism/mediafile_meta.go b/internal/photoprism/mediafile_meta.go index 4616edd11..9ac054991 100644 --- a/internal/photoprism/mediafile_meta.go +++ b/internal/photoprism/mediafile_meta.go @@ -106,7 +106,7 @@ func (m *MediaFile) MetaData() (result meta.Data) { if err != nil { m.metaData.Error = err - log.Debugf("metadata: %s in %s", err, clean.Log(m.BaseName())) + log.Debugf("%s in %s", err, clean.Log(m.BaseName())) } }) diff --git a/internal/photoprism/mediafile_thumbs_test.go b/internal/photoprism/mediafile_thumbs_test.go index 19c5b2e80..1bc85f604 100644 --- a/internal/photoprism/mediafile_thumbs_test.go +++ b/internal/photoprism/mediafile_thumbs_test.go @@ -200,6 +200,29 @@ func TestMediaFile_CreateThumbnails(t *testing.T) { assert.FileExists(t, thumbFilename) assert.NoError(t, m.CreateThumbnails(thumbsPath, false)) }) + + t.Run("broken/animated-earth.jpg", func(t *testing.T) { + m, err := NewMediaFile("testdata/broken/animated-earth.jpg") + + if err != nil { + t.Fatal(err) + } + + err = m.CreateThumbnails(thumbsPath, true) + + if err != nil { + t.Fatal(err) + } + + thumbFilename, err := thumb.FileName(m.Hash(), thumbsPath, thumb.Sizes[thumb.Tile50].Width, thumb.Sizes[thumb.Tile50].Height, thumb.Sizes[thumb.Tile50].Options...) + + if err != nil { + t.Fatal(err) + } + + assert.FileExists(t, thumbFilename) + assert.NoError(t, m.CreateThumbnails(thumbsPath, false)) + }) } func TestMediaFile_ChangeOrientation(t *testing.T) { diff --git a/internal/photoprism/testdata/broken/animated-earth.jpg b/internal/photoprism/testdata/broken/animated-earth.jpg new file mode 100644 index 000000000..dcee9825c Binary files /dev/null and b/internal/photoprism/testdata/broken/animated-earth.jpg differ