02-28-2024, 11:08 PM
If you mean the folder form the image, then:
- Given timg
- timg.filename is the complete path to the file the image was loaded from
- os.path.dirname(some_path) extracts the parent directory in a path
- so what you want is in os.path.dirname(timg.filename)
Code:
import os # somewhere at the top of your file, otherwise os.path.dirname won't be resolved
pdb.python_fu_ofn_export_layers(timg, os.path.dirname(timg.filename)), "{numUp0}.png", "-", 0)