You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Phil Blake <ph...@tcp.net.au> on 2001/10/19 08:59:15 UTC

SVG, JPEG, PNG and Xvfb

Hi all,

I'm making an attempt to get SVG's working.

My understanding is that svg2jpeg and svg2png currently has a dependency 
on Xvfb.

I'm running MacOS X so I installed Xfree86, including Xvfb and used the 
script submitted by someone on the list:

if [ "$1" = "stop" ] ; then
     # kill off any framebuffer running, kill kill kill :-)
     kill -TERM `/sbin/pidof Xvfb`
elif [ "$1"="start" -o "$1"="run" ] ; then
     # start up a virtual framebuffer for cocoon2's rendering
     Xvfb :1 -screen 0 320x240x24 &
fi

I called the script xfb and ran it:

phil% xfb start

All looked good. There was a process Xvfb running. WooHoo.

I then trashed the Tomcat work directory for cocoon and started up 
Tomcat, pointed it at cocoon and waited for the startup.

All looked good.

I selected the sample "scalable vector graphics - An example of a SVG 
file rendered to a PNG image. "

The following image was produced: (it's been scaled down so as not to 
annoy, and make the email small enough to make it onto the list)
<File attached: test.jpg>

To save you looking at it, the image is rendered the same way it was 
before running Xvfb - strangely.

I'll move everything to aix and try again.

Until the dependency problem is resolved, it may be a good idea to put a 
warning in the documentation that the svg2jpeg and svg2png functionality 
is limited to specific configurations. I mention this because we'd 
planned to provide a cocoon-based site to a company that hosts using NT 
(yes we know that's a stupid idea anyhow) however I'm assuming that 
there are going to be Xvfb issues under windows - If someone can 
enlighten me as to cocoon svg/jpeg/png served under windows it would be 
much appreciated.

We only have one client that uses windows so this is not a major issue.

Thanks in advance. Have fun,

Phil

Re: SVG, JPEG, PNG and Xvfb

Posted by Martijn Bouterse <ma...@surfnet.nl>.
Phil Blake wrote:
> 
> Hi all,
> 
> I'm making an attempt to get SVG's working.
> 
> My understanding is that svg2jpeg and svg2png currently has a dependency on Xvfb.

For Linux the SVG Java libraries (Apache Batik) as used in Cocoon 2
depend on a X display. As Linux can perfectly function without X-Windows
this causes some problems for most Linux servers that don't have
X-Windows installed. MS Windows and other GUI based os's don't have this
problem.

> I'm running MacOS X so I installed Xfree86, including Xvfb and used the script submitted by someone on the list:

AFAIK, MacOS X is a GUI operating system, so there should be no problems
using the Batik libraries.

> if [ "$1" = "stop" ] ; then
> # kill off any framebuffer running, kill kill kill :-)
> kill -TERM `/sbin/pidof Xvfb`
> elif [ "$1"="start" -o "$1"="run" ] ; then
> # start up a virtual framebuffer for cocoon2's rendering
> Xvfb :1 -screen 0 320x240x24 &
> fi
> 
> I called the script xfb and ran it:
> 
> phil% xfb start
> 
> All looked good. There was a process Xvfb running. WooHoo.
> 
> I then trashed the Tomcat work directory for cocoon and started up Tomcat, pointed it at cocoon and waited for the startup.
> 
> All looked good.
> 
> I selected the sample "scalable vector graphics - An example of a SVG file rendered to a PNG image. "
> 
> The following image was produced: (it's been scaled down so as not to annoy, and make the email small enough to make it onto the list)
> To save you looking at it, the image is rendered the same way it was before running Xvfb - strangely.

This looks more like a problem with a stylesheet or with Batik itself.

Regards,
Martijn Bouterse

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG, JPEG, PNG and Xvfb

Posted by Jeff Turner <je...@socialchange.net.au>.
On Fri, Oct 19, 2001 at 04:59:15PM +1000, Phil Blake wrote:
> Hi all,
> 
> I'm making an attempt to get SVG's working.
> 
> My understanding is that svg2jpeg and svg2png currently has a dependency 
> on Xvfb.
> 
> I'm running MacOS X so I installed Xfree86, including Xvfb and used the 
> script submitted by someone on the list:
> 
> if [ "$1" = "stop" ] ; then
>      # kill off any framebuffer running, kill kill kill :-)
>      kill -TERM `/sbin/pidof Xvfb`
> elif [ "$1"="start" -o "$1"="run" ] ; then
>      # start up a virtual framebuffer for cocoon2's rendering
>      Xvfb :1 -screen 0 320x240x24 &
                         ^^^^^^^^^^

320x240 is a rather miserable little framebuffer ;) Perhaps try increasing to
1024x768 or something. Just guessing.

FYI, here's some Xvfb install notes I wrote for non-Cocoon stuff:

http://newgate.socialchange.net.au/~jeff/docs/tomcat/Xvfb.html


--Jeff

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>