From 59573b1fb8e5a47f924a636f0f46bd64ed19747e Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 20 Dec 2021 12:33:14 +0000 Subject: whitespace and error clarity changes --- cmd/rescribe/main.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go index 89eb590..8224830 100644 --- a/cmd/rescribe/main.go +++ b/cmd/rescribe/main.go @@ -471,21 +471,19 @@ func startProcess(logger log.Logger, tessCommand string, bookdir string, booknam if err != nil { log.Fatalf("Error moving hocr %s to hocr directory: %v", v, err) } - + pngname := strings.Replace(v, ".hocr", ".png", 1) err = os.MkdirAll(filepath.Join(savedir, "png"), 0755) if err != nil { - log.Fatalf("Error creating hocr directory: %v", err) + log.Fatalf("Error creating png directory: %v", err) } - + err = os.Rename(pngname, filepath.Join(savedir, "png", filepath.Base(pngname))) if err != nil { - log.Fatalf("Error moving png %s to hocr directory: %v", pngname, err) + log.Fatalf("Error moving png %s to png directory: %v", pngname, err) } - - } - + } // For simplicity, remove .binarised.pdf and rename .colour.pdf to .pdf _ = os.Remove(filepath.Join(savedir, bookname+".binarised.pdf")) @@ -549,7 +547,7 @@ func downloadbook(dir string, name string, conn Pipeliner) error { if err != nil { return fmt.Errorf("Error downloading best pages: %v", err) } - + err1 := pipeline.DownloadBestPngs(dir, name, conn) if err1 != nil { return fmt.Errorf("Error downloading best pngs: %v", err) -- cgit v1.2.1-24-ge1ad