fix(thumbnailer): missing font panic

This commit is contained in:
Florian Schade
2025-12-31 12:17:11 +01:00
parent 38786ab291
commit 9c651af32d
3 changed files with 24 additions and 4 deletions
@@ -149,6 +149,17 @@ var _ = Describe("ImageDecoder", func() {
Expect(err).ToNot(HaveOccurred())
Expect(img).ToNot(BeNil())
})
It("fails if the font is missing", func() {
decoder.fontLoader.fontMapData = &FontMapData{
FMap: &FontMap{
DefaultFont: "/some/unknown/font.otf",
},
}
img, err := decoder.Convert(bytes.NewReader([]byte("This is a test text")))
Expect(err).To(HaveOccurred())
Expect(img).To(BeNil())
})
})
Describe("test ForType", func() {