From 3c8147b7a0ce0f220256ae4da735c68238041a20 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Fri, 30 Dec 2022 01:25:23 +0100 Subject: [PATCH] allow rar/zip too --- internal/epub/image_processing.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/epub/image_processing.go b/internal/epub/image_processing.go index 606187b..a524352 100644 --- a/internal/epub/image_processing.go +++ b/internal/epub/image_processing.go @@ -53,9 +53,9 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) { imageCount, imageInput, err = loadDir(path) } else { switch ext := strings.ToLower(filepath.Ext(path)); ext { - case ".cbz": + case ".cbz", "zip": imageCount, imageInput, err = loadCbz(path) - case ".cbr": + case ".cbr", "rar": imageCount, imageInput, err = loadCbr(path) case ".pdf": err = fmt.Errorf("not implemented") @@ -220,7 +220,7 @@ func loadCbr(input string) (int, chan *imageTask, error) { return 0, nil, err } - bar := progressbar.DefaultBytes(rs.Size(), "Uncompressing") + bar := progressbar.DefaultBytes(rs.Size(), "Uncompressing rar") defer bar.Close() r, err := rardecode.NewReader(io.TeeReader(rr, bar), "")