How can I export an image with Script-Fu to the folder with the GIMP file?

624 Views Asked by At

My Script works, but the exported file will be saved in my user folder. How can I automatically export the .png to the folder with my GIMP file?

(define (script-fu-biz-scale Image Layer Drawable)
    (gimp-layer-sca080le Layer 1920 1 TRUE)
    (file-png-save 1 Image Drawable "BizScale.png" "BizScale.png" 0 0 0 0 0 0 0)
)

(script-fu-register
    "script-fu-biz-scale"
    "<Image>/Filters/BizScale"
    "Scaling images automaticly"
    "Lukas"
    "Lukas"
    "12.12.2022"
    "RGB*"
    SF-IMAGE "Image" 0
    SF-DRAWABLE "Layer" 0
    SF-DRAWABLE "Drawable" 0
)
1

There are 1 best solutions below

1
On

You could use gimp-image-get-filename to get the filepath of your original image, strip off the filename and add the new file name.