break on error while creating pdf

This commit is contained in:
Sebastian Hugentobler 2019-05-27 17:23:06 +02:00
parent 4d8005c111
commit d525e7c013

View File

@ -33,8 +33,7 @@ func ImgsToPdf(dir string, output string) error {
img, _, err := image.DecodeConfig(reader) img, _, err := image.DecodeConfig(reader)
if err != nil { if err != nil {
//return err return err
continue
} }
pdf.AddPageFormat("P", gofpdf.SizeType{Wd: float64(img.Width), Ht: float64(img.Height)}) pdf.AddPageFormat("P", gofpdf.SizeType{Wd: float64(img.Width), Ht: float64(img.Height)})
@ -43,7 +42,6 @@ func ImgsToPdf(dir string, output string) error {
pdf.RegisterImageOptionsReader(f.Name(), opt, reader) pdf.RegisterImageOptionsReader(f.Name(), opt, reader)
pdf.ImageOptions(f.Name(), 0, 0, 0, 0, false, opt, 0, "") pdf.ImageOptions(f.Name(), 0, 0, 0, 0, false, opt, 0, "")
reader.Close() reader.Close()
} }