mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 00:02:37 +02:00
auto option
This commit is contained in:
parent
259bf6bb7b
commit
eef33a4c40
@ -78,6 +78,8 @@ The ePub include as a first page:
|
||||
Usage of go-comic-converter:
|
||||
-author string
|
||||
Author of the epub (default "GO Comic Converter")
|
||||
-auto
|
||||
Activate all automatic options
|
||||
-autorotate
|
||||
Auto Rotate page when width > height
|
||||
-autosplitdoublepage
|
||||
|
7
main.go
7
main.go
@ -66,6 +66,7 @@ type Option struct {
|
||||
NoCrop bool
|
||||
Brightness int
|
||||
Contrast int
|
||||
Auto bool
|
||||
AutoRotate bool
|
||||
AutoSplitDoublePage bool
|
||||
Workers int
|
||||
@ -142,6 +143,7 @@ func main() {
|
||||
flag.BoolVar(&opt.NoCrop, "nocrop", false, "Disable cropping")
|
||||
flag.IntVar(&opt.Brightness, "brightness", 0, "Brightness readjustement: between -100 and 100, > 0 lighter, < 0 darker")
|
||||
flag.IntVar(&opt.Contrast, "contrast", 0, "Contrast readjustement: between -100 and 100, > 0 more contrast, < 0 less contrast")
|
||||
flag.BoolVar(&opt.Auto, "auto", false, "Activate all automatic options")
|
||||
flag.BoolVar(&opt.AutoRotate, "autorotate", false, "Auto Rotate page when width > height")
|
||||
flag.BoolVar(&opt.AutoSplitDoublePage, "autosplitdoublepage", false, "Auto Split double page when width > height")
|
||||
flag.IntVar(&opt.LimitMb, "limitmb", 0, "Limit size of the ePub: Default nolimit (0), Minimum 20")
|
||||
@ -226,6 +228,11 @@ func main() {
|
||||
opt.Title = filepath.Base(defaultOutput[0 : len(defaultOutput)-len(ext)])
|
||||
}
|
||||
|
||||
if opt.Auto {
|
||||
opt.AutoRotate = true
|
||||
opt.AutoSplitDoublePage = true
|
||||
}
|
||||
|
||||
fmt.Fprintln(os.Stderr, opt)
|
||||
|
||||
if err := epub.NewEpub(&epub.EpubOptions{
|
||||
|
Loading…
x
Reference in New Issue
Block a user