mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
remove pointer from image options
This commit is contained in:
parent
5c7775cd47
commit
e10eeadc4e
@ -22,7 +22,7 @@ type View struct {
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
Crop *Crop
|
||||
Crop Crop
|
||||
Quality int
|
||||
Brightness int
|
||||
Contrast int
|
||||
@ -34,7 +34,7 @@ type Image struct {
|
||||
NoBlankImage bool
|
||||
Manga bool
|
||||
HasCover bool
|
||||
View *View
|
||||
View View
|
||||
GrayScale bool
|
||||
GrayScaleMode int
|
||||
Resize bool
|
||||
@ -56,10 +56,10 @@ type Options struct {
|
||||
Quiet bool
|
||||
Json bool
|
||||
Workers int
|
||||
Image *Image
|
||||
Image Image
|
||||
}
|
||||
|
||||
func (o *Options) WorkersRatio(pct int) (nbWorkers int) {
|
||||
func (o Options) WorkersRatio(pct int) (nbWorkers int) {
|
||||
nbWorkers = o.Workers * pct / 100
|
||||
if nbWorkers < 1 {
|
||||
nbWorkers = 1
|
||||
@ -67,6 +67,6 @@ func (o *Options) WorkersRatio(pct int) (nbWorkers int) {
|
||||
return
|
||||
}
|
||||
|
||||
func (o *Options) ImgStorage() string {
|
||||
func (o Options) ImgStorage() string {
|
||||
return fmt.Sprintf("%s.tmp", o.Output)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ type ContentOptions struct {
|
||||
Author string
|
||||
Publisher string
|
||||
UpdatedAt string
|
||||
ImageOptions *epuboptions.Image
|
||||
ImageOptions epuboptions.Image
|
||||
Cover *epubimage.Image
|
||||
Images []*epubimage.Image
|
||||
Current int
|
||||
|
6
main.go
6
main.go
@ -124,8 +124,8 @@ $ go install github.com/celogeek/go-comic-converter/v%d@%s
|
||||
DryVerbose: cmd.Options.DryVerbose,
|
||||
Quiet: cmd.Options.Quiet,
|
||||
Json: cmd.Options.Json,
|
||||
Image: &epuboptions.Image{
|
||||
Crop: &epuboptions.Crop{
|
||||
Image: epuboptions.Image{
|
||||
Crop: epuboptions.Crop{
|
||||
Enabled: cmd.Options.Crop,
|
||||
Left: cmd.Options.CropRatioLeft,
|
||||
Up: cmd.Options.CropRatioUp,
|
||||
@ -145,7 +145,7 @@ $ go install github.com/celogeek/go-comic-converter/v%d@%s
|
||||
NoBlankImage: cmd.Options.NoBlankImage,
|
||||
Manga: cmd.Options.Manga,
|
||||
HasCover: cmd.Options.HasCover,
|
||||
View: &epuboptions.View{
|
||||
View: epuboptions.View{
|
||||
Width: profile.Width,
|
||||
Height: profile.Height,
|
||||
AspectRatio: cmd.Options.AspectRatio,
|
||||
|
Loading…
x
Reference in New Issue
Block a user