allow rar/zip too

This commit is contained in:
Celogeek 2022-12-30 01:25:23 +01:00
parent f8b353e1bf
commit 3c8147b7a0
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A

View File

@ -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), "")