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() }