mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 07:42:37 +02:00
add limit to crop limit
This commit is contained in:
parent
9133493e60
commit
c500755a4e
@ -389,6 +389,11 @@ func (c *Converter) Validate() error {
|
||||
return errors.New("grayscale mode should be 0, 1 or 2")
|
||||
}
|
||||
|
||||
// crop
|
||||
if c.Options.CropLimit < 0 || c.Options.CropLimit > 100 {
|
||||
return errors.New("crop limit should be between 0 and 100")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ func (o *Options) ShowConfig() string {
|
||||
{"Grayscale", o.Grayscale, true},
|
||||
{"Grayscale mode", grayscaleMode, o.Grayscale},
|
||||
{"Crop", o.Crop, true},
|
||||
{"Crop ratio", fmt.Sprintf("%d Left - %d Up - %d Right - %d Bottom - %d%% Limit", o.CropRatioLeft, o.CropRatioUp, o.CropRatioRight, o.CropRatioBottom, o.CropLimit), o.Crop},
|
||||
{"Crop ratio", fmt.Sprintf("%d Left - %d Up - %d Right - %d Bottom - Limit %d%%", o.CropRatioLeft, o.CropRatioUp, o.CropRatioRight, o.CropRatioBottom, o.CropLimit), o.Crop},
|
||||
{"Brightness", o.Brightness, o.Brightness != 0},
|
||||
{"Contrast", o.Contrast, o.Contrast != 0},
|
||||
{"Auto contrast", o.AutoContrast, true},
|
||||
|
Loading…
x
Reference in New Issue
Block a user