Lua Script GIMP doesn't waits for GIMP locks when it's previously opened
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 65/100
Direzione di ricerca
Apri contrib/gimp.lua e ispeziona la costruzione del comando GIMP intorno alla riga 99. Riproduci il workflow con GIMP già in esecuzione, quindi applica la modifica al comando proposta e verifica che la sessione di modifica attenda, che il file sorgente rimanga disponibile e che la reimportazione in darktable riesca dopo la chiusura di GIMP.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description of the Issue
The contrib/gimp.lua script fails to open images in GIMP when an instance of GIMP is already running. The image is exported by Darktable, but GIMP displays a "No such file or directory" error, and the image is never re-imported into Darktable.
The Root Cause
Race Condition The script's logic relies on the GIMP process being blocking (waiting until the application closes) to proceed to the file cleanup/re-import phase.
Scenario A (GIMP Closed): The script works. The process blocks, user edits, closes GIMP, and the script continues.
Scenario B (GIMP Open): Modern GIMP behavior (especially GIMP 3.0 AppImages or modern 2.10 distros using DBus) defaults to "Single Instance" mode. The command sends a signal to the running instance and returns control immediately (non-blocking) to the shell.
Because of this non-blocking return, the Lua script immediately proceeds to df.file_move, moving/renaming the source file before the GIMP instance (which queues the open request as an idle job) has a chance to read it.
Verification
GIMP 3.0 (AppImage): Confirmed failure due to immediate process return.
GIMP 2.10 (Ubuntu Studio Repo): Confirmed failure on a standard, fresh install, ruling out custom environment issues.
CLI Reproduction: gimp image.jpg && mv image.jpg destination.jpg reproduces the failure in the terminal (GIMP fails to read because mv happens instantly).
The Solution According to GIMP Developer Jehan (discussed in GNOME/gimp #14827), the correct way to maintain the script's intended sequential workflow (Edit -> Wait -> Re-import) is to force a new instance.
Adding the --new-instance flag forces GIMP to spawn a new process that blocks the terminal until that specific window is closed, preventing the race condition.
Proposed Change In contrib/gimp.lua, modify the command construction:
Lua
-- Current implementation (around line 99) gimpStartCommand = gimp_executable .. " " .. img_list
-- Proposed fix
gimpStartCommand = gimp_executable .. " --new-instance " .. img_list
Result of the Fix I verified this locally. With --new-instance, the script correctly waits for the editing session to close, the file remains available for GIMP to read, and the re-import to Darktable succeeds upon closing the window.
- Lingua principale
- Lua
- Stelle
- 219
- Fork
- 142
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di darktable-org/lua-scripts
-
dtutils.string: build_substitute_list errors when a metadata field (e.g. rights) has been removed Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
darktable-org/lua-scripts#716 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
darktable-org/lua-scripts#706 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
darktable-org/lua-scripts#627 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
darktable-org/lua-scripts#710 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
darktable-org/lua-scripts#708 · 1 commento ·
Tutte le issue di darktable-org/lua-scripts
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
api7/lua-resty-saml#62 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nvim-tree/nvim-tree.lua#3357 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
codymikol/multiverse.nvim#320 ·
-
Data Correction tbc
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100