Repository navigation
Fix auto levels on GIMP 3.2 - #60
tarikkircali-amg wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe auto-levels path now looks up ChangesAuto-levels procedure lookup
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The auto-levels update is compatible with the supported GIMP 3.2 procedure API and presents no concrete merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
_auto_levelslooks up the PDB proceduregimp-levels-stretch:That procedure does not exist in GIMP 3.2.6, so
lookup_procedurereturnsNoneand the code takes itselsefallback, which callsgimp-drawable-levelswith identity parameters (low-input=0.0,high-input=1.0,gamma=1.0,low-output=0.0,high-output=1.0). That identity mapping returns SUCCESS but does not change the image — soauto_levelssilently does nothing on GIMP 3.2 while reporting success.GIMP 3.2.6 provides the correct procedure
gimp-drawable-levels-stretch, which takes a singledrawableargument — exactly what the existingif proc:branch already passes.Fix
One line — switch the lookup to the procedure that exists in GIMP 3.2:
The
if proc:branch (set_property("drawable", drawable)thenproc.run(cfg)) already matches the single-argument signature, so no other change is needed. The identity fallback is left untouched (out of scope).Verification
Live GIMP 3.2.6 runtime test of the fixed path (
gimp-drawable-levels-stretch, singledrawablearg) on a temporary, unsaved deterministic low-contrast grayscale image (stored value range 100–150):The range is genuinely stretched (std_dev and min/max spread both increase). For reference, the old identity fallback left every one of these values unchanged.
The test used a temporary in-memory image that was deleted afterward; the open-image list was identical before and after (no residue), and no pre-existing image was touched.
python -m py_compile gimp-mcp-plugin.pypassed.git diff --checkpassed.Scope: 1 line changed (1 insertion, 1 deletion) in
gimp-mcp-plugin.py.Summary by CodeRabbit