Re: Invoking custom Gimp module from Web (Apache)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the hints ...
Some interesting developments while running under sudo.
The first run:

-----------------------------
sudo -u www-data gimp --no-interface --batch='(python-fu-pdf2jpg
RUN-NONINTERACTIVE
"/dd/d/app/front/PAK_live/srvr/xformx.com/run/pdf_forms/le-50.0.11.01(2008-10)d8.pdf"
)'  --batch='(gimp-quit 1)'
-----------------------------

gives error:
error: Cannot create folder '/var/www/.gimp-2.6': Permission denied


So I temporarily opened up /var/www with permission 777
and tried previous command again - to see that gimp is going to write
in the /var/www directory:

----------------------------------

sudo -u www-data gimp --no-interface --batch='(python-fu-pdf2jpg
RUN-NONINTERACTIVE
"/dd/d/app/front/PAK_live/srvr/xformx.com/run/pdf_forms/le-50.0.11.01(2008-10)d8.pdf"
)'  --batch='(gimp-quit 1)'
No protocol specified
/var/lib/python-support/python2.6/gtk-2.0/gtk/__init__.py:72:
GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
No protocol specified

(file-uri:5738): Gtk-WARNING **: cannot open display: :0.0

(gimp:5568): LibGimpBase-WARNING **: gimp: gimp_wire_read(): error
No protocol specified
/var/lib/python-support/python2.6/gtk-2.0/gtk/__init__.py:72:
GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
batch command executed successfully

----------------------------------

This 2nd run interesting things (FINALLY) happened :)
The most important is the last line: it says that gimp executed
my plugin, and indeed, it did (wrote some debug file to the
filesystem, as expected).

Also, after examining '/var/www', I see that gimp created 2 new directories:

drwx------  4 www-data www-data 4096 2009-10-02 15:38 .gegl-0.0
drwxr-xr-x 21 www-data www-data 4096 2009-10-02 15:38 .gimp-2.6

I don't know how safe it is to keep these Gimp directories inside my
main apache directory - it probably opens up some hole of some kind -
but anyway, priority now is to make Gimp happy. I'll deal with holes
inside my web server later ...

Conclusion: it seems Gimp needed these 2 dirs in that place, as now
it seems to work with my preliminary (i.e. debugging) code.
The key was to run that gimp command as
"sudo -u www-data gimp ..."
to get that error message. Before that, I had no idea what Gimp
was complaining about, or if it was even invoked at all ...

Thanks for your help, suggestions, and happy Gimping all !
(I'll be 'web-gimping' in my case :)
vio
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux