mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 00:02:37 +02:00
add shortcut
This commit is contained in:
parent
728129aba2
commit
abf3b8facf
@ -130,6 +130,10 @@ func (c *Converter) InitParse() {
|
|||||||
c.AddSection("Shortcut")
|
c.AddSection("Shortcut")
|
||||||
c.AddBoolParam(&c.Options.Auto, "auto", false, "Activate all automatic options")
|
c.AddBoolParam(&c.Options.Auto, "auto", false, "Activate all automatic options")
|
||||||
c.AddBoolParam(&c.Options.NoFilter, "nofilter", false, "Deactivate all filters")
|
c.AddBoolParam(&c.Options.NoFilter, "nofilter", false, "Deactivate all filters")
|
||||||
|
c.AddBoolParam(&c.Options.MaxQuality, "maxquality", false, "Max quality: color png + noresize")
|
||||||
|
c.AddBoolParam(&c.Options.BestQuality, "bestquality", false, "Max quality: color jpg q100 + noresize")
|
||||||
|
c.AddBoolParam(&c.Options.GreatQuality, "greatquality", false, "Max quality: grayscale jpg q90 + noresize")
|
||||||
|
c.AddBoolParam(&c.Options.GoodQuality, "goodquality", false, "Max quality: grayscale jpg q90")
|
||||||
|
|
||||||
c.AddSection("Other")
|
c.AddSection("Other")
|
||||||
c.AddIntParam(&c.Options.Workers, "workers", runtime.NumCPU(), "Number of workers")
|
c.AddIntParam(&c.Options.Workers, "workers", runtime.NumCPU(), "Number of workers")
|
||||||
@ -217,6 +221,27 @@ func (c *Converter) Parse() {
|
|||||||
c.Options.AutoSplitDoublePage = true
|
c.Options.AutoSplitDoublePage = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Options.MaxQuality {
|
||||||
|
c.Options.Format = "png"
|
||||||
|
c.Options.Grayscale = false
|
||||||
|
c.Options.NoResize = true
|
||||||
|
} else if c.Options.BestQuality {
|
||||||
|
c.Options.Format = "jpeg"
|
||||||
|
c.Options.Quality = 100
|
||||||
|
c.Options.Grayscale = false
|
||||||
|
c.Options.NoResize = true
|
||||||
|
} else if c.Options.GreatQuality {
|
||||||
|
c.Options.Format = "jpeg"
|
||||||
|
c.Options.Quality = 90
|
||||||
|
c.Options.Grayscale = true
|
||||||
|
c.Options.NoResize = true
|
||||||
|
} else if c.Options.GoodQuality {
|
||||||
|
c.Options.Format = "jpeg"
|
||||||
|
c.Options.Quality = 90
|
||||||
|
c.Options.Grayscale = true
|
||||||
|
c.Options.NoResize = false
|
||||||
|
}
|
||||||
|
|
||||||
if c.Options.NoFilter {
|
if c.Options.NoFilter {
|
||||||
c.Options.Crop = false
|
c.Options.Crop = false
|
||||||
c.Options.Brightness = 0
|
c.Options.Brightness = 0
|
||||||
|
@ -50,8 +50,12 @@ type Options struct {
|
|||||||
Reset bool `yaml:"-"`
|
Reset bool `yaml:"-"`
|
||||||
|
|
||||||
// Shortcut
|
// Shortcut
|
||||||
Auto bool `yaml:"-"`
|
Auto bool `yaml:"-"`
|
||||||
NoFilter bool `yaml:"-"`
|
NoFilter bool `yaml:"-"`
|
||||||
|
MaxQuality bool `yaml:"-"`
|
||||||
|
BestQuality bool `yaml:"-"`
|
||||||
|
GreatQuality bool `yaml:"-"`
|
||||||
|
GoodQuality bool `yaml:"-"`
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
Workers int `yaml:"-"`
|
Workers int `yaml:"-"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user