Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Out of Sequence?
#2
  • pdb.gimp_image_resize() is the API equivalent of Image>Canvas size, but it only applies to the canvas, so the layers are not affected  (as if you selected Resize layers: None).
  • pdb.gimp_file_save() saves the drawable, not the image. Since the previous call did not change the layer size, the saved image has the original size.
  • The easiest way to fix this is to call pdb.gimp_layer_new_from_visible() (this creates a layer which is what you see in the canvas...) and save that layer (you don't even need to explicitly add it to the image IIRC).
  • A more proper way is to crop the layer before you save it.
Reply


Messages In This Thread
Python Out of Sequence? - by Kjaamor - 09-22-2023, 04:31 PM
RE: Python Out of Sequence? - by Ofnuts - 09-22-2023, 08:32 PM
RE: Python Out of Sequence? - by Kjaamor - 09-23-2023, 09:16 AM

Forum Jump: