I'm working on a project that is trying to make some image processing
functionality available[1] to a server process. This is not intended to
be a high volume/high performance product.

My problem is that whenever I invoke any JAI functionality[2] that calls
down to the Java2D or AWT libraries, the process tries to connect to the
X server on the host machine. While I of course have an X server on my
development machine, a server host may not even have a display, much
less an X server. Furthermore, touching the X server causes network
traffic and CPU load that we would prefer to avoid.

This behavior of Java2D/AWT makes perfect sense for these GUI oriented
toolkits but limits the usability of dependent packages, including JAI.
If this requirement is hard, then JAI is potentially off-limits to
anyone who wants to perform batch processing.

What I am wondering is:
A) Can I pre-initialize Java2D in some way to make it not connect to a
display server? In essence, I want to inform this library that I will
only be using it for internal processing and that no display will be
required.
B) Does Java2D actually require the display server for computation? For
example, does it use X for dithering or other image computations? I ask
this because it has been suggested that we write a dummy X server which
will return successfully from any calls but do no work.
C) Is there someone I can convince that this is a real problem?

I have been in touch with the JAI gurus, and they are unable to advise
me on the internals or requirements of Java2D. Since Jimi has been
acquired by Sun, my only hope is that there is some way to work within
Java2D or that there is an alternate imaging library unknown to me. I
doubt that the upcoming Image I/O project will remove the dependence of
the Sun image codecs on Java2D/AWT since that code is so widespread.

Thanks,
Todd

[1] The Java library we are trying to use is JAI, which is based on the
Java2D API.
[2] For example, reading a JPEG image file.

Reply via email to