From d525e7c0133f6d848ae93f4f96aca85edd01092f Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 27 May 2019 17:23:06 +0200 Subject: [PATCH] break on error while creating pdf --- pkg/ecload/pdf.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/ecload/pdf.go b/pkg/ecload/pdf.go index 655562c..9df75fd 100644 --- a/pkg/ecload/pdf.go +++ b/pkg/ecload/pdf.go @@ -33,8 +33,7 @@ func ImgsToPdf(dir string, output string) error { img, _, err := image.DecodeConfig(reader) if err != nil { - //return err - continue + return err } 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.ImageOptions(f.Name(), 0, 0, 0, 0, false, opt, 0, "") - reader.Close() }