Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp 3 Python Script - Merge Visible - No Flatten Image?
#6
(04-01-2025, 02:47 PM): silenuznowan Wrote: I'm not trying to do something specific, I'm trying to determine if there is a bug in gimp so I can report it or if there's an error in the documentation so I can report it, well if possible.

Screenshot should be here but it says too much data even though it's just 26k

Look at the  Gimp 3  python browser, look up merge-visible-layers.  Note the parameters for merge type.

Note also there is an enum value in the MergeType object called FLATTEN_IMAGE

However passing that enum value, or the equivalent integer shown in the browser documentation, the result is the following error.


Quote:GIMP-Error: Calling error for procedure 'gimp-image-merge-visible-layers':

Procedure 'gimp-image-merge-visible-layers' has been called with value 'GIMP_FLATTEN_IMAGE' for argument 'merge-type' (#2, type GimpMergeType). This value is out of range.

So it would seem either the docs are incorrect or there is a bug.

You are inferring that because an API accepts an enumeration, all the values of the enumeration are valid for the API. 

This is not true.

There are other examples: Gimp.context_set_paint_mode () takes a Gimp.LayerMode, and so does Gimp.Layer.set_mode(). But Gimp.Layer.set_mode() won't accept Gimp.LayerMode.BEHIND or Gimp.LayerMode.BEHIND_LEGACY that can only be used for painting, and presumably neither of them will accept Gimp.LayerMode.REPLACE which is specific to GEGL filters.
Reply


Messages In This Thread
RE: Gimp 3 Python Script - Merge Visible - No Flatten Image? - by Ofnuts - 04-01-2025, 09:24 PM

Forum Jump: