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 {
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)
}

View File

@ -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

View File

@ -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,