summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaill <ck.daill@gmail.com>2018-04-20 21:28:40 +0200
committerKurt Jung <kurt.w.jung@gmail.com>2018-04-20 15:28:40 -0400
commit0298ebb7bb539ad17daadce86bedbdfd56c2bcd4 (patch)
tree468213b03bc137a2014d34651b5101187cbebe6e
parent892fe1b63b9a9f0b7bcdcdcdeb96cb6fe0d0a2bb (diff)
EOF error when using reader (#176)
While you're using a reader for i.e. an image you'll receive an EOF from go's io package which leads to pdf creation error
-rw-r--r--fpdf.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdf.go b/fpdf.go
index 0e7071f..f6ec511 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2990,7 +2990,7 @@ func (f *Fpdf) parsepng(r io.Reader, readdpi bool) (info *ImageInfoType) {
func (f *Fpdf) readBeInt32(r io.Reader) (val int32) {
err := binary.Read(r, binary.BigEndian, &val)
- if err != nil {
+ if err != nil && err != io.EOF {
f.err = err
}
return