Rename PHOTOPRISM_CONVERT_SIZE to PHOTOPRISM_JPEG_SIZE #388

Naming more consistent with PHOTOPRISM_JPEG_QUALITY.

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-14 14:30:19 +02:00
parent 9eafc8c844
commit f4e8b59c3b
10 changed files with 19 additions and 19 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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"`
}

View File

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

View File

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

View File

@ -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() != "" {