Situation: My gimp python plug-in shows the user a drop down box with two options [".jpg", ".png"].
Question: How to show a second input window with conditional content based on first input?
- .jpg --> "Quality" range slider [0 - 100]
- .png --> "Compression" range slider [0 - 9]
In different words: How to trigger a (registered) plug-in WITH user-input-window from within the main function of a plug-in?
Either you build a full GUI with PyGTK (or perhaps tkinter) or you find another way. Typically for this if you stick to the auto-generated dialogs you have the choice between:
On the other hand, I have always use compression level 9 in my PNGs (AFAIK the only benefit of other levels is CPU time, but this is moot in modern machines) so your dialog could only ask for the JPEG quality which would mak it less clumsy.
However... JPEG quality isn't all there is to it and there are actually many options (chroma sub-sampling being IMHO at least as important as quality), and to satisfy all needs you could end up with a rather complex dialog. So you could either:
gimp_file_save()
)