break on error while creating pdf
This commit is contained in:
parent
4d8005c111
commit
d525e7c013
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user