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)
|
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user