Darktable: Disable presets by default

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-21 12:18:53 +02:00
parent d20d9c50dd
commit 710888c59f
10 changed files with 22 additions and 18 deletions

View File

@ -41,7 +41,8 @@ services:
# PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_JPEG_QUALITY: 90 # Set to 95 for high-quality thumbnails (requires more storage)
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Use darktable presets (disables concurrent raw to jpeg conversion)
PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool
PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files
CODECOV_TOKEN: CODECOV_TOKEN:

View File

@ -55,7 +55,8 @@ services:
# PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_JPEG_QUALITY: 90 # Set to 95 for high-quality thumbnails (requires more storage)
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Use darktable presets (disables concurrent raw to jpeg conversion)
PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool PHOTOPRISM_SIDECAR_JSON: "true" # Read metadata from JSON sidecar files created by exiftool
PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files PHOTOPRISM_SIDECAR_YAML: "true" # Backup photo metadata to YAML sidecar files

View File

@ -45,7 +45,8 @@ services:
# PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_JPEG_QUALITY: 90 # Set to 95 for high-quality thumbnails (requires more storage)
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Use darktable presets (disables concurrent raw to jpeg conversion)
PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index
volumes: volumes:
- "~/Pictures/Originals:/photoprism/originals" # [local path]:[container path] - "~/Pictures/Originals:/photoprism/originals" # [local path]:[container path]

View File

@ -44,7 +44,8 @@ services:
# PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD # PHOTOPRISM_THUMB_SIZE: 4096 # Retina 4K, DCI 4K (requires more storage); 7680 for 8K Ultra HD
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680) PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000) PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 90 # Use 95 for high-quality thumbnails (requires more storage) PHOTOPRISM_JPEG_QUALITY: 90 # Set to 95 for high-quality thumbnails (requires more storage)
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Use darktable presets (disables concurrent raw to jpeg conversion)
PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index PHOTOPRISM_STORAGE_PATH: "/photoprism/storage" # Storage PATH for generated files like cache and index
volumes: volumes:
- "~/Pictures/Originals:/photoprism/originals" # [local path]:[container path] - "~/Pictures/Originals:/photoprism/originals" # [local path]:[container path]

View File

@ -87,7 +87,7 @@ func configAction(ctx *cli.Context) error {
// External binaries and sidecar configuration. // External binaries and sidecar configuration.
fmt.Printf("%-25s %s\n", "darktable-bin", conf.DarktableBin()) fmt.Printf("%-25s %s\n", "darktable-bin", conf.DarktableBin())
fmt.Printf("%-25s %t\n", "darktable-unlock", conf.DarktableUnlock()) fmt.Printf("%-25s %t\n", "darktable-presets", conf.DarktablePresets())
fmt.Printf("%-25s %s\n", "sips-bin", conf.SipsBin()) fmt.Printf("%-25s %s\n", "sips-bin", conf.SipsBin())
fmt.Printf("%-25s %s\n", "heifconvert-bin", conf.HeifConvertBin()) fmt.Printf("%-25s %s\n", "heifconvert-bin", conf.HeifConvertBin())
fmt.Printf("%-25s %s\n", "ffmpeg-bin", conf.FFmpegBin()) fmt.Printf("%-25s %s\n", "ffmpeg-bin", conf.FFmpegBin())

View File

@ -5,7 +5,7 @@ func (c *Config) DarktableBin() string {
return findExecutable(c.params.DarktableBin, "darktable-cli") return findExecutable(c.params.DarktableBin, "darktable-cli")
} }
// DarktableUnlock checks if presets should be disabled to run multiple instances concurrently. // DarktablePresets checks if presets should be enabled (disables concurrent raw to jpeg conversion).
func (c *Config) DarktableUnlock() bool { func (c *Config) DarktablePresets() bool {
return c.params.DarktableUnlock return c.params.DarktablePresets
} }

View File

@ -5,10 +5,10 @@ import (
"testing" "testing"
) )
func TestConfig_DarktableUnlock(t *testing.T) { func TestConfig_DarktablePresets(t *testing.T) {
c := NewConfig(CliTestContext()) c := NewConfig(CliTestContext())
assert.False(t, c.DarktableUnlock()) assert.False(t, c.DarktablePresets())
} }
func TestConfig_Darktablebin(t *testing.T) { func TestConfig_Darktablebin(t *testing.T) {

View File

@ -191,9 +191,9 @@ var GlobalFlags = []cli.Flag{
EnvVar: "PHOTOPRISM_DARKTABLE_BIN", EnvVar: "PHOTOPRISM_DARKTABLE_BIN",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "darktable-unlock", Name: "darktable-presets",
Usage: "disable presets to run multiple instances concurrently", Usage: "use darktable presets (disables concurrent raw to jpeg conversion)",
EnvVar: "PHOTOPRISM_DARKTABLE_UNLOCK", EnvVar: "PHOTOPRISM_DARKTABLE_PRESETS",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "sips-bin", Name: "sips-bin",

View File

@ -66,7 +66,7 @@ type Params struct {
HttpServerPassword string `yaml:"http-password" flag:"http-password"` HttpServerPassword string `yaml:"http-password" flag:"http-password"`
SipsBin string `yaml:"sips-bin" flag:"sips-bin"` SipsBin string `yaml:"sips-bin" flag:"sips-bin"`
DarktableBin string `yaml:"darktable-bin" flag:"darktable-bin"` DarktableBin string `yaml:"darktable-bin" flag:"darktable-bin"`
DarktableUnlock bool `yaml:"darktable-unlock" flag:"darktable-unlock"` DarktablePresets bool `yaml:"darktable-presets" flag:"darktable-presets"`
HeifConvertBin string `yaml:"heifconvert-bin" flag:"heifconvert-bin"` HeifConvertBin string `yaml:"heifconvert-bin" flag:"heifconvert-bin"`
FFmpegBin string `yaml:"ffmpeg-bin" flag:"ffmpeg-bin"` FFmpegBin string `yaml:"ffmpeg-bin" flag:"ffmpeg-bin"`
ExifToolBin string `yaml:"exiftool-bin" flag:"exiftool-bin"` ExifToolBin string `yaml:"exiftool-bin" flag:"exiftool-bin"`

View File

@ -173,12 +173,12 @@ func (c *Convert) JpegConvertCommand(mf *MediaFile, jpegName string, xmpName str
var args []string var args []string
// Only one instance of darktable-cli allowed due to locking if presets are loaded. // Only one instance of darktable-cli allowed due to locking if presets are loaded.
if c.conf.DarktableUnlock() { if c.conf.DarktablePresets() {
useMutex = false
args = []string{"--apply-custom-presets", "false", "--width", size, "--height", size, mf.FileName()}
} else {
useMutex = true useMutex = true
args = []string{"--width", size, "--height", size, mf.FileName()} args = []string{"--width", size, "--height", size, mf.FileName()}
} else {
useMutex = false
args = []string{"--apply-custom-presets", "false", "--width", size, "--height", size, mf.FileName()}
} }
if xmpName != "" { if xmpName != "" {