diff options
-rw-r--r-- | fpdf_test.go | 22 | ||||
-rw-r--r-- | image/sweden.png | bin | 0 -> 472 bytes |
2 files changed, 22 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index e82217a..4774ec6 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -78,6 +78,28 @@ func TestIssue0116(t *testing.T) { } } +// TestIssue0193 addresses issue 193 in which the error io.EOF is incorrectly +// assigned to the FPDF instance error. +func TestIssue0193(t *testing.T) { + var png []byte + var pdf *gofpdf.Fpdf + var err error + var rdr *bytes.Reader + + png, err = ioutil.ReadFile(example.ImageFile("sweden.png")) + if err == nil { + rdr = bytes.NewReader(png) + pdf = gofpdf.New("P", "mm", "A4", "") + pdf.AddPage() + _ = pdf.RegisterImageOptionsReader("sweden", gofpdf.ImageOptions{ImageType: "png", ReadDpi: true}, rdr) + err = pdf.Error() + } + if err != nil { + t.Fatalf("issue 193 error: %s", err) + } + +} + // Test to make sure the footer is not call twice and SetFooterFuncLpi can work // without SetFooterFunc. func TestFooterFuncLpi(t *testing.T) { diff --git a/image/sweden.png b/image/sweden.png Binary files differnew file mode 100644 index 0000000..22f6e7e --- /dev/null +++ b/image/sweden.png |