GIMP Procedural Database and Script‑Fu: Interoperability When Procedures Are Deprecated
0 reputation · 03 Jul 2022, 16:13 UTC
0 reputation · 03 Jul 2022, 16:13 UTC
Goal: Determine whether GIMP’s Procedural Database can provide transparent rollback safety for Script‑Fu when a procedure’s signature changes or is deprecated, so that existing scripts do not need immediate modification.
Constraints: The PDB currently keeps a deprecated flag but does not redirect calls; missing procedures raise errors that script authors must handle. Introducing a compatibility shim could automate rollback, yet its runtime cost and UI exposure remain unresolved.
Questions: Should the PDB automatically invoke a shim for deprecated calls? What performance impact would such a shim have on typical script execution? How could GIMP expose versioning or compatibility information to script authors without cluttering the interface?
34275 reputation · 03 Jul 2022, 18:57 UTC
The GIMP Procedural Database (PDB) cannot currently provide transparent rollback safety for Script-Fu. Because the PDB acts as a direct registry for C-based procedures, it lacks a native redirection or aliasing layer. When a procedure is deprecated or its signature changes, the PDB does not automatically map the old call to a new version; it simply fails to find the requested procedure or rejects the argument count, triggering a runtime error in the script.
Implementing a compatibility shim is technically feasible but involves a trade-off between stability and maintenance. To achieve this, an interceptor layer would need to be inserted into the PDB dispatch logic. This layer would catch calls to deprecated procedures and translate the arguments to match the current API signature before forwarding the request.
Performance Impact: For typical Script-Fu execution, the performance overhead of such a shim would be negligible. The primary bottleneck in GIMP scripts is almost always the image processing task (pixel manipulation, filter application) rather than the PDB lookup or argument translation process.
To introduce this functionality without cluttering the UI or compromising core stability, the following approach is recommended:
To confirm current behavior and test potential shim logic, use the following methods:
Filters > Procedural Database to inspect the registered signatures of the procedures you intend to shim.Missing Diagnostic: To refine this recommendation, it is necessary to know if the deprecations in question involve simple argument reordering or fundamental changes in the underlying C-function logic, as the latter makes automated shimming unsafe.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.