From e10eeadc4e193353d5711bfb1d067890c6117cd7 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Fri, 10 May 2024 18:10:07 +0200 Subject: [PATCH] remove pointer from image options --- internal/epub/options/epub_options.go | 10 +++++----- internal/epub/templates/epub_templates_content.go | 2 +- main.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/epub/options/epub_options.go b/internal/epub/options/epub_options.go index 2d2367a..d41a499 100644 --- a/internal/epub/options/epub_options.go +++ b/internal/epub/options/epub_options.go @@ -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) } diff --git a/internal/epub/templates/epub_templates_content.go b/internal/epub/templates/epub_templates_content.go index 7b3a662..1544806 100644 --- a/internal/epub/templates/epub_templates_content.go +++ b/internal/epub/templates/epub_templates_content.go @@ -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 diff --git a/main.go b/main.go index 23c238d..e26c226 100644 --- a/main.go +++ b/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,