Uzyskiwanie zmiennej Unbound podczas próby wykonania tego skryptu z wiersza polecenia systemu Windows
Działa idealnie z menu GIMP, ale nie z polecenia
SET gimpEXE="C:\Program Files\GIMP 2\bin\gimp-2.8.exe"
for %i in ("C:\Users\abeta4\Desktop\ImgTest\*.jpg") do %gimpEXE% -i -b "(python-fu-resize %i TRUE)" -b "(gimp-quit 0)"
Potem skrypt #! / usr / bin / python
from gimpfu import *
def plugin_main(timg, tdrawable, savecopy=TRUE):
newWidth = 768
newHeight = 1080
timgsx = "sx"
pdb.gimp_image_scale(timg, newWidth, newHeight)
if savecopy:
pdb.file_png_save2(timg, tdrawable, "C:\\Users\\abeta4\\Downloads\\%s%s.png" % (timgsx, timg.name), timg.name+".jpg", 1,9,1,1,1,1,1,0,1)
register(
"python_fu_resize",
"Saves the image at a maximum width and height",
"Saves the image at a maximum width and height",
"xxx",
"xxx",
"2017",
"<Image>/Image/Resize For Screens, Now Even Easier :)...",
"*",
[
(PF_BOOL, "copy", "Make a PNG copy", TRUE),
],
[],
plugin_main)
main()
Początkujący Python tutaj, przepraszam za błędy w skrypcie.