diff --git a/internal/commands/config.go b/internal/commands/config.go index ab85f61a4..fe3507ad4 100644 --- a/internal/commands/config.go +++ b/internal/commands/config.go @@ -152,7 +152,7 @@ func configAction(ctx *cli.Context) error { fmt.Printf("%-25s %s\n", "download-token", conf.DownloadToken()) fmt.Printf("%-25s %s\n", "preview-token", conf.PreviewToken()) fmt.Printf("%-25s %s\n", "thumb-filter", conf.ThumbFilter()) - fmt.Printf("%-25s %s\n", "thumb-colorspace", conf.ThumbColorspace()) + fmt.Printf("%-25s %s\n", "thumb-color", conf.ThumbColor()) fmt.Printf("%-25s %t\n", "thumb-uncached", conf.ThumbUncached()) fmt.Printf("%-25s %d\n", "thumb-size", conf.ThumbSizePrecached()) fmt.Printf("%-25s %d\n", "thumb-size-uncached", conf.ThumbSizeUncached()) diff --git a/internal/config/config.go b/internal/config/config.go index 555ce6ad4..b6e54d99c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -158,7 +158,7 @@ func (c *Config) Propagate() { log.SetLevel(c.LogLevel()) // Set thumbnail generation parameters. - thumb.StandardRGB = c.ThumbStandardRGB() + thumb.StandardRGB = c.ThumbSRGB() thumb.SizePrecached = c.ThumbSizePrecached() thumb.SizeUncached = c.ThumbSizeUncached() thumb.Filter = c.ThumbFilter() diff --git a/internal/config/flags.go b/internal/config/flags.go index 2ae52c6e2..b8866a969 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -479,10 +479,10 @@ var GlobalFlags = []cli.Flag{ EnvVar: "PHOTOPRISM_THUMB_FILTER", }, cli.StringFlag{ - Name: "thumb-colorspace", - Usage: "standard colorspace for thumbnails (\"\" to disable)", + Name: "thumb-color", + Usage: "standard color `PROFILE` for thumbnails (leave blank to disable)", Value: "sRGB", - EnvVar: "PHOTOPRISM_THUMB_COLORSPACE", + EnvVar: "PHOTOPRISM_THUMB_COLOR", }, cli.BoolFlag{ Name: "thumb-uncached, u", diff --git a/internal/config/options.go b/internal/config/options.go index 765c031e6..a2701f953 100644 --- a/internal/config/options.go +++ b/internal/config/options.go @@ -127,7 +127,7 @@ type Options struct { DownloadToken string `yaml:"DownloadToken" json:"-" flag:"download-token"` PreviewToken string `yaml:"PreviewToken" json:"-" flag:"preview-token"` ThumbFilter string `yaml:"ThumbFilter" json:"ThumbFilter" flag:"thumb-filter"` - ThumbColorspace string `yaml:"ThumbColorspace" json:"ThumbColorspace" flag:"thumb-colorspace"` + ThumbColor string `yaml:"ThumbColor" json:"ThumbColor" flag:"thumb-color"` ThumbUncached bool `yaml:"ThumbUncached" json:"ThumbUncached" flag:"thumb-uncached"` ThumbSize int `yaml:"ThumbSize" json:"ThumbSize" flag:"thumb-size"` ThumbSizeUncached int `yaml:"ThumbSizeUncached" json:"ThumbSizeUncached" flag:"thumb-size-uncached"` diff --git a/internal/config/resample.go b/internal/config/resample.go index 1d413ea73..dee8540d4 100644 --- a/internal/config/resample.go +++ b/internal/config/resample.go @@ -43,14 +43,14 @@ func (c *Config) ThumbPath() string { return c.CachePath() + "/thumbnails" } -// ThumbColorspace returns the standard colorspace for thumbnails. -func (c *Config) ThumbColorspace() string { - return c.options.ThumbColorspace +// ThumbColor returns the color profile name for thumbnails. +func (c *Config) ThumbColor() string { + return c.options.ThumbColor } -// ThumbStandardRGB checks if colors should be normalized to standard RGB in thumbnails. -func (c *Config) ThumbStandardRGB() bool { - return strings.ToLower(c.ThumbColorspace()) == "srgb" +// ThumbSRGB checks if colors should be normalized to standard RGB in thumbnails. +func (c *Config) ThumbSRGB() bool { + return strings.ToLower(c.ThumbColor()) == "srgb" } // ThumbUncached checks if on-demand thumbnail rendering is enabled (high memory and cpu usage).