Ho seguito this tutorial e questo è quello che ho fornito finora:Gimp: lo script python non mostrando nel menù
#!/usr/bin/python
# -*- coding: utf-8 -*-
#http://www.ibm.com/developerworks/library/os-autogimp/
from gimpfu import*
def plugin_main(timg, tdrawable, maxh=540, maxw=800):
currentWidth = tdrawable.width
currentHeight = tdrawable.height
newWidth = currentWidth
newHeight = currentHeight
if (maxw < newWidth):
newWidth = maxw
newHeight = (float(currentHeight)/(float(currentWidth)/newWidth))
if (maxh < newHeight):
newHeight = maxh
newWidth = (float(currentWidth)/(float(currentHeight)/newHeight))
pdb.gimp_image_scale(timg, newWidth, newHeight)
register(
"python_fu_resize",
"Saves the image at a maximum width and height",
"Saves the image at a maximum width and height",
"N N",
"N N",
"2013",
"<Image>/Image/Resize to max...",
"*",
[],
[],
plugin_main)
main()
Ma il plugin woun't presentarsi nel menu di gimp (sto usando gimp 2.8). Ha dato il file chmod a + x diritti. Potrebbe essere un problema il percorso del file: /.gimp-2.8/plug-ins/src/resize.py? Il src è a causa di eclissi.
Apportate alcune modifiche: aggiunto lo spazio mancante e spostato lo script in '/ usr/lib/gimp/2.0/plug-in'. Ora appare nel menu. Grazie. – kyng
Un altro consiglio per il debug: avvia gimp dalla riga di comando e puoi vedere che tipo di messaggi di errore appaiono. – kyng
Assicurarsi che lo script sia eseguibile. L'esecuzione di '$ chmod + x plugin.py' ha risolto il problema per me. – arunkumar