diff --git a/docker-compose.travis.yml b/docker-compose.travis.yml index 021ce95a3..c5c08465b 100644 --- a/docker-compose.travis.yml +++ b/docker-compose.travis.yml @@ -39,7 +39,7 @@ services: PHOTOPRISM_THUMB_UNCACHED: "true" # Enable on-demand thumbnail rendering (high memory and cpu usage) PHOTOPRISM_THUMB_SIZE: 2048 # Pre-rendered thumbnail size limit (default 2048, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 4096 # On-demand rendering size limit (default 4096, min 720, max 7680) - PHOTOPRISM_CONVERT_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) + PHOTOPRISM_JPEG_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files diff --git a/docker-compose.yml b/docker-compose.yml index dfaf22280..52e70be87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,7 +53,7 @@ services: PHOTOPRISM_THUMB_UNCACHED: "true" # Enable on-demand thumbnail rendering (high memory and cpu usage) PHOTOPRISM_THUMB_SIZE: 2048 # Pre-rendered thumbnail size limit (default 2048, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 4096 # On-demand rendering size limit (default 4096, min 720, max 7680) - PHOTOPRISM_CONVERT_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) + PHOTOPRISM_JPEG_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files diff --git a/docker/photoprism/arm64/docker-compose.yml b/docker/photoprism/arm64/docker-compose.yml index 5f5efa3af..e60857b93 100644 --- a/docker/photoprism/arm64/docker-compose.yml +++ b/docker/photoprism/arm64/docker-compose.yml @@ -45,7 +45,7 @@ services: # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage) PHOTOPRISM_THUMB_SIZE_UNCACHED: 4096 # On-demand rendering size limit (default 4096, min 720, max 7680) # PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # Retina 6K, 8K Ultra HD - PHOTOPRISM_CONVERT_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) + PHOTOPRISM_JPEG_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index volumes: diff --git a/docker/photoprism/docker-compose.yml b/docker/photoprism/docker-compose.yml index ee1d11c7b..f0a4195ce 100644 --- a/docker/photoprism/docker-compose.yml +++ b/docker/photoprism/docker-compose.yml @@ -44,7 +44,7 @@ services: # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage) PHOTOPRISM_THUMB_SIZE_UNCACHED: 4096 # On-demand rendering size limit (default 4096, min 720, max 7680) # PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # Retina 6K, 8K Ultra HD - PHOTOPRISM_CONVERT_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) + PHOTOPRISM_JPEG_SIZE: 4096 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index volumes: diff --git a/internal/commands/config.go b/internal/commands/config.go index 51c0eba7e..ed6c65e56 100644 --- a/internal/commands/config.go +++ b/internal/commands/config.go @@ -88,7 +88,7 @@ func configAction(ctx *cli.Context) error { // External binaries and sidecar configuration. fmt.Printf("%-25s %s\n", "darktable-bin", conf.DarktableBin()) fmt.Printf("%-25s %t\n", "darktable-unlock", conf.DarktableUnlock()) - fmt.Printf("%-25s %d\n", "darktable-size", conf.ConvertSize()) + fmt.Printf("%-25s %d\n", "darktable-size", conf.JpegSize()) fmt.Printf("%-25s %s\n", "sips-bin", conf.SipsBin()) fmt.Printf("%-25s %s\n", "heifconvert-bin", conf.HeifConvertBin()) fmt.Printf("%-25s %s\n", "ffmpeg-bin", conf.FFmpegBin()) diff --git a/internal/config/flags.go b/internal/config/flags.go index 5c5b7510e..6d442460b 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -290,10 +290,10 @@ var GlobalFlags = []cli.Flag{ EnvVar: "PHOTOPRISM_THUMB_SIZE_UNCACHED", }, cli.IntFlag{ - Name: "convert-size", + Name: "jpeg-size", Usage: "size limit for converted image files in `PIXELS` (720-30000)", Value: 4096, - EnvVar: "PHOTOPRISM_CONVERT_SIZE", + EnvVar: "PHOTOPRISM_JPEG_SIZE", }, cli.IntFlag{ Name: "jpeg-quality, q", diff --git a/internal/config/params.go b/internal/config/params.go index 1afc93d96..cdbfe4b3a 100644 --- a/internal/config/params.go +++ b/internal/config/params.go @@ -85,7 +85,7 @@ type Params struct { ThumbUncached bool `yaml:"thumb-uncached" flag:"thumb-uncached"` ThumbSize int `yaml:"thumb-size" flag:"thumb-size"` ThumbSizeUncached int `yaml:"thumb-size-uncached" flag:"thumb-size-uncached"` - ConvertSize int `yaml:"convert-size" flag:"convert-size"` + JpegSize int `yaml:"jpeg-size" flag:"jpeg-size"` JpegQuality int `yaml:"jpeg-quality" flag:"jpeg-quality"` } diff --git a/internal/config/resample.go b/internal/config/resample.go index 2c44513e1..35723f7a5 100644 --- a/internal/config/resample.go +++ b/internal/config/resample.go @@ -6,15 +6,15 @@ import ( "github.com/photoprism/photoprism/internal/thumb" ) -// ConvertSize return the size limit for automatically converted files in `PIXELS` (720-30000). -func (c *Config) ConvertSize() int { - if c.params.ConvertSize < 720 { +// JpegSize returns the size limit for automatically converted files in `PIXELS` (720-30000). +func (c *Config) JpegSize() int { + if c.params.JpegSize < 720 { return 720 - } else if c.params.ConvertSize > 30000 { + } else if c.params.JpegSize > 30000 { return 30000 } - return c.params.ConvertSize + return c.params.JpegSize } // JpegQuality returns the jpeg quality for resampling, use 95 for high-quality thumbs (25-100). diff --git a/internal/config/resample_test.go b/internal/config/resample_test.go index a365e1b66..599f7882b 100644 --- a/internal/config/resample_test.go +++ b/internal/config/resample_test.go @@ -9,11 +9,11 @@ import ( func TestConfig_ConvertSize(t *testing.T) { c := NewConfig(CliTestContext()) - assert.Equal(t, int(720), c.ConvertSize()) - c.params.ConvertSize = 31000 - assert.Equal(t, int(30000), c.ConvertSize()) - c.params.ConvertSize = 800 - assert.Equal(t, int(800), c.ConvertSize()) + assert.Equal(t, int(720), c.JpegSize()) + c.params.JpegSize = 31000 + assert.Equal(t, int(30000), c.JpegSize()) + c.params.JpegSize = 800 + assert.Equal(t, int(800), c.JpegSize()) } func TestConfig_JpegQuality(t *testing.T) { diff --git a/internal/photoprism/convert.go b/internal/photoprism/convert.go index af519424d..3c0a652d8 100644 --- a/internal/photoprism/convert.go +++ b/internal/photoprism/convert.go @@ -159,7 +159,7 @@ func (c *Convert) ToJson(mf *MediaFile) (*MediaFile, error) { // JpegConvertCommand returns the command for converting files to JPEG, depending on the format. func (c *Convert) JpegConvertCommand(mf *MediaFile, jpegName string, xmpName string) (result *exec.Cmd, useMutex bool, err error) { - size := strconv.Itoa(c.conf.ConvertSize()) + size := strconv.Itoa(c.conf.JpegSize()) if mf.IsRaw() { if c.conf.SipsBin() != "" {