add nofilter option

This commit is contained in:
Celogeek 2023-05-01 17:25:19 +02:00
parent ee00ed2615
commit 58cd5f5399
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
2 changed files with 11 additions and 0 deletions

View File

@ -128,6 +128,7 @@ func (c *Converter) InitParse() {
c.AddBoolParam(&c.Options.Reset, "reset", false, "Reset your parameters to default")
c.AddSection("Other")
c.AddBoolParam(&c.Options.NoFilter, "nofilter", false, "Disable all filter")
c.AddIntParam(&c.Options.Workers, "workers", runtime.NumCPU(), "Number of workers")
c.AddBoolParam(&c.Options.Dry, "dry", false, "Dry run to show all options")
c.AddBoolParam(&c.Options.DryVerbose, "dry-verbose", false, "Display also sorted files after the TOC")
@ -212,6 +213,15 @@ func (c *Converter) Parse() {
c.Options.AutoRotate = true
c.Options.AutoSplitDoublePage = true
}
if c.Options.NoFilter {
c.Options.Crop = false
c.Options.Brightness = 0
c.Options.Contrast = 0
c.Options.AutoRotate = false
c.Options.NoBlankImage = false
c.Options.NoResize = true
}
}
// Check parameters

View File

@ -51,6 +51,7 @@ type Options struct {
// Other
Workers int `yaml:"-"`
NoFilter bool `yaml:"-"`
Dry bool `yaml:"-"`
DryVerbose bool `yaml:"-"`
Quiet bool `yaml:"-"`