PNG image creation without a physical display

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

 



Hello,

I have a general question about how GTK+ can be used and after my
investigations have lead me nowhere, I thought I would post to the list.

I have an application that reads data from a database and renders
probability density function plots thereof to the user's display via my
gui program.

Over time, the users expressed the desire to output these images to be
viewable elsewise.  Using libpng and the appropriate GTK+ routines, it was
easy to output these images to a .png file on disk (for viewing by a
web-browser, for example).

Continuing the idea, the users requested that the middle-man, i.e., the
gui, be completely cut out of the process: produce a program that reads
the data from the database and writes directly to .png files.

I have done this without problem, I can read data, make images and output
them to disk in .png format just fine, as long as there's a physical
display available.

The problem comes when I attempt to execute this job under cron (analysis
data is created on a server, stored in a database, followed by a program
to read this data and create images for automatic web display), or if
executed directly on a server machine with no physical display (but with
X11 and GTK+ installed).

When doing in either manner, my gtk_init() fails since there is no
(alleged) existence of a display.

My questions are two:

1) when run under cron, there ma be, in fact, an X-server running (say,
serving the login splash screen), just not for the executing user.  Is
there any way to force a gtk+ program to connect to an X-server running on
the same machine from within a cron execution?

2) more ideally, however, I would like to be able to write a program that
does not in any way have to rely on an X-server instance running at all. 
All drawing routines in GTK+ demand a drawable, which, in turn, require
that gtk_init() be called before-hand.

So, in general, is it possible to write a drawing program using GTK+ that
outputs a .png image without having to rely on the physical existence of a
screen or an X-server?

Or must I resort to using some other library or program?  Or am I missing
something obvious here (which I hope)?

thanks for any tips or pointers, this is really the final open question
that will make the system I've been developing for the last three years
(graphically, at least) complete.

cheers,

richard boaz

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux