diff --git a/docker/demo/Dockerfile b/docker/demo/Dockerfile index 128ec6f57..caf4cd557 100644 --- a/docker/demo/Dockerfile +++ b/docker/demo/Dockerfile @@ -12,6 +12,11 @@ ENV PHOTOPRISM_PUBLIC true ENV PHOTOPRISM_EXPERIMENTAL true ENV PHOTOPRISM_UPLOAD_NSFW false ENV PHOTOPRISM_HIDE_NSFW false +ENV PHOTOPRISM_THUMB_QUALITY 95 +ENV PHOTOPRISM_THUMB_SIZE 3840 +ENV PHOTOPRISM_THUMB_LIMIT 3840 +ENV PHOTOPRISM_THUMB_ALGORITHM lanczos +ENV PHOTOPRISM_GEOCODING_API places # Import example photos RUN photoprism import diff --git a/internal/config/config.go b/internal/config/config.go index 0b19b23b2..f5e6dbed5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -239,9 +239,11 @@ func (c *Config) ThumbLimit() int { return c.config.ThumbLimit } -// ThumbAlgorithm returns the thumbnail algorithm name (lanczos, cubic or linear). +// ThumbAlgorithm returns the thumbnail resample algorithm (blackman, lanczos, cubic or linear). func (c *Config) ThumbAlgorithm() thumb.ResampleAlgorithm { switch strings.ToLower(c.config.ThumbAlgorithm) { + case "blackman": + return thumb.ResampleBlackman case "lanczos": return thumb.ResampleLanczos case "cubic": @@ -249,7 +251,7 @@ func (c *Config) ThumbAlgorithm() thumb.ResampleAlgorithm { case "linear": return thumb.ResampleLinear default: - return thumb.ResampleLanczos + return thumb.ResampleCubic } } diff --git a/internal/config/flags.go b/internal/config/flags.go index 70d4672eb..578954742 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -238,20 +238,20 @@ var GlobalFlags = []cli.Flag{ }, cli.IntFlag{ Name: "thumb-size, s", - Usage: "pre-rendered thumbnail size limit in pixels (720-3840)", + Usage: "pre-render size limit in pixels (720-3840)", Value: 2048, EnvVar: "PHOTOPRISM_THUMB_SIZE", }, cli.IntFlag{ Name: "thumb-limit, x", - Usage: "on-demand thumbnail size limit in pixels (720-3840)", + Usage: "on-demand size limit in pixels (720-3840)", Value: 3840, EnvVar: "PHOTOPRISM_THUMB_LIMIT", }, cli.StringFlag{ Name: "thumb-algorithm, a", - Usage: "thumbnail algorithm (lanczos, cubic or linear)", - Value: "lanczos", + Usage: "resample algorithm (blackman, lanczos, cubic or linear)", + Value: "cubic", EnvVar: "PHOTOPRISM_THUMB_ALGORITHM", }, } diff --git a/internal/thumb/types.go b/internal/thumb/types.go index f956933be..94d89b701 100644 --- a/internal/thumb/types.go +++ b/internal/thumb/types.go @@ -11,15 +11,18 @@ var ( ) const ( - ResampleLanczos ResampleAlgorithm = "lanczos" - ResampleCubic = "cubic" - ResampleLinear = "linear" + ResampleBlackman ResampleAlgorithm = "blackman" + ResampleLanczos ResampleAlgorithm = "lanczos" + ResampleCubic ResampleAlgorithm = "cubic" + ResampleLinear ResampleAlgorithm = "linear" ) type ResampleAlgorithm string func (a ResampleAlgorithm) Filter() imaging.ResampleFilter { switch a { + case ResampleBlackman: + return imaging.Blackman case ResampleLanczos: return imaging.Lanczos case ResampleCubic: