From 49e7f27a59887ffd5ac461dc4c0ea6b8fd1606b9 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Tue, 3 Jan 2023 19:58:31 +0100 Subject: [PATCH] fix progress bar --- internal/epub/image_processing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/epub/image_processing.go b/internal/epub/image_processing.go index 3589542..27336fd 100644 --- a/internal/epub/image_processing.go +++ b/internal/epub/image_processing.go @@ -169,14 +169,15 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) { go func() { wg.Wait() - bar.Close() close(imageOutput) }() + bar := NewBar(imageCount, "Processing", 1, 2) for image := range imageOutput { images = append(images, image) bar.Add(1) } + bar.Close() if len(images) == 0 { return nil, fmt.Errorf("image not found")