summaryrefslogtreecommitdiff
path: root/cmd/extracthocrlines
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/extracthocrlines')
-rw-r--r--cmd/extracthocrlines/main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/extracthocrlines/main.go b/cmd/extracthocrlines/main.go
index 34652ea..c213d9f 100644
--- a/cmd/extracthocrlines/main.go
+++ b/cmd/extracthocrlines/main.go
@@ -40,6 +40,7 @@ func saveline(l line.Detail, dir string) error {
if err != nil {
return fmt.Errorf("Error creating file %s: %v", base+".png", err)
}
+ defer f.Close()
err = l.Img.CopyLineTo(f)
if err != nil {
@@ -50,6 +51,7 @@ func saveline(l line.Detail, dir string) error {
if err != nil {
return fmt.Errorf("Error creating file %s: %v", base+".txt", err)
}
+ defer f.Close()
_, err = io.WriteString(f, l.Text)
if err != nil {