Skip to content

Using jpeg() function over cgi

2 messages · michael watson (IAH-C), Brian Ripley

#
Hi

I have seen a few posts to this list regarding problems accessing the x11() device over cgi - namely, when trying to create a graphic using the jpeg() function, everything is fine from the command line but it won't work over cgi, producing the error:

"Unable to open connection to X11 display"

Has anyone actually solved this particular problem satisfactorily?

Please reply direct to me as I am not a member of the list (yet!)

Thanks in advance for your help

Michael Watson
Head of Informatics
Institute for Animal Health,
Compton Laboratory,
Compton,
Newbury,
Berkshire RG20 7NN
UK

Phone : +44 (0)1635 578411 ext. 2535
Mobile: +44 (0)7764 490236
E-mail: michael.watson at bbsrc.ac.uk
#
Yes, it has been solved and discussed in the R-help archives many times.
The help(jpeg) page is pretty explicit too.  One alternative is bitmap().

To use jpeg() under a Unix-alike you need to set up an X server that your
R process can use.  It's a bit hard to help you do that when you don't
even mention your OS (I am inferring it is a Unix-alike), but you may be
able to solve the permissions problem or you may be able to set by a
server by something like Xvfb.  In any case, it is not an R problem
On Fri, 13 Jun 2003, michael watson (IAH-C) wrote:

            
No, not the x11() device, but the jpeg() device.  They are not the same!