remove pointer from image options

This commit is contained in:
Celogeek 2024-05-10 18:10:07 +02:00
parent 5c7775cd47
commit e10eeadc4e
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
3 changed files with 9 additions and 9 deletions

View File

@ -22,7 +22,7 @@ type View struct {
} }
type Image struct { type Image struct {
Crop *Crop Crop Crop
Quality int Quality int
Brightness int Brightness int
Contrast int Contrast int
@ -34,7 +34,7 @@ type Image struct {
NoBlankImage bool NoBlankImage bool
Manga bool Manga bool
HasCover bool HasCover bool
View *View View View
GrayScale bool GrayScale bool
GrayScaleMode int GrayScaleMode int
Resize bool Resize bool
@ -56,10 +56,10 @@ type Options struct {
Quiet bool Quiet bool
Json bool Json bool
Workers int 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 nbWorkers = o.Workers * pct / 100
if nbWorkers < 1 { if nbWorkers < 1 {
nbWorkers = 1 nbWorkers = 1
@ -67,6 +67,6 @@ func (o *Options) WorkersRatio(pct int) (nbWorkers int) {
return return
} }
func (o *Options) ImgStorage() string { func (o Options) ImgStorage() string {
return fmt.Sprintf("%s.tmp", o.Output) return fmt.Sprintf("%s.tmp", o.Output)
} }

View File

@ -16,7 +16,7 @@ type ContentOptions struct {
Author string Author string
Publisher string Publisher string
UpdatedAt string UpdatedAt string
ImageOptions *epuboptions.Image ImageOptions epuboptions.Image
Cover *epubimage.Image Cover *epubimage.Image
Images []*epubimage.Image Images []*epubimage.Image
Current int Current int

View File

@ -124,8 +124,8 @@ $ go install github.com/celogeek/go-comic-converter/v%d@%s
DryVerbose: cmd.Options.DryVerbose, DryVerbose: cmd.Options.DryVerbose,
Quiet: cmd.Options.Quiet, Quiet: cmd.Options.Quiet,
Json: cmd.Options.Json, Json: cmd.Options.Json,
Image: &epuboptions.Image{ Image: epuboptions.Image{
Crop: &epuboptions.Crop{ Crop: epuboptions.Crop{
Enabled: cmd.Options.Crop, Enabled: cmd.Options.Crop,
Left: cmd.Options.CropRatioLeft, Left: cmd.Options.CropRatioLeft,
Up: cmd.Options.CropRatioUp, Up: cmd.Options.CropRatioUp,
@ -145,7 +145,7 @@ $ go install github.com/celogeek/go-comic-converter/v%d@%s
NoBlankImage: cmd.Options.NoBlankImage, NoBlankImage: cmd.Options.NoBlankImage,
Manga: cmd.Options.Manga, Manga: cmd.Options.Manga,
HasCover: cmd.Options.HasCover, HasCover: cmd.Options.HasCover,
View: &epuboptions.View{ View: epuboptions.View{
Width: profile.Width, Width: profile.Width,
Height: profile.Height, Height: profile.Height,
AspectRatio: cmd.Options.AspectRatio, AspectRatio: cmd.Options.AspectRatio,