mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
allow rar/zip too
This commit is contained in:
parent
f8b353e1bf
commit
3c8147b7a0
@ -53,9 +53,9 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) {
|
|||||||
imageCount, imageInput, err = loadDir(path)
|
imageCount, imageInput, err = loadDir(path)
|
||||||
} else {
|
} else {
|
||||||
switch ext := strings.ToLower(filepath.Ext(path)); ext {
|
switch ext := strings.ToLower(filepath.Ext(path)); ext {
|
||||||
case ".cbz":
|
case ".cbz", "zip":
|
||||||
imageCount, imageInput, err = loadCbz(path)
|
imageCount, imageInput, err = loadCbz(path)
|
||||||
case ".cbr":
|
case ".cbr", "rar":
|
||||||
imageCount, imageInput, err = loadCbr(path)
|
imageCount, imageInput, err = loadCbr(path)
|
||||||
case ".pdf":
|
case ".pdf":
|
||||||
err = fmt.Errorf("not implemented")
|
err = fmt.Errorf("not implemented")
|
||||||
@ -220,7 +220,7 @@ func loadCbr(input string) (int, chan *imageTask, error) {
|
|||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
bar := progressbar.DefaultBytes(rs.Size(), "Uncompressing")
|
bar := progressbar.DefaultBytes(rs.Size(), "Uncompressing rar")
|
||||||
defer bar.Close()
|
defer bar.Close()
|
||||||
|
|
||||||
r, err := rardecode.NewReader(io.TeeReader(rr, bar), "")
|
r, err := rardecode.NewReader(io.TeeReader(rr, bar), "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user