Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp 2.10 'with files' batch
#2
You don't need "with_files" in Python since you have something like this already in the language:

Code:
import glob

for file in glob.glob(sourcedir+'/*.xcf'):  # '/' also works in Windows
   img=pdb.gimp_file_load(file)
   pdb.gimp_image_set_resolution(img, 96.0, 96.0)
   pdb.gimp_file_save(img, drawable, file, file)    
   pdb.gimp_image_clean_all(img)
   pdb.gimp_image_delete(image) # only removes the image from Gimp!

You stuff this a plugin that takes a single argument that you declare as a PF_DIRNAME in the registration. The user starts the script from a Gimp menu; enters the directory, and there you go.

Coded "from the hip", so some mistakes/oversight possible.

You can make that a shell batch but it's a bit more complicated.
Reply


Messages In This Thread
Gimp 2.10 'with files' batch - by rich2005 - 11-15-2018, 11:34 AM
RE: Gimp 2.10 'with files' batch - by Ofnuts - 11-15-2018, 01:53 PM

Forum Jump: