Monday, June 04, 2007

okular and PS files

I'm having some problems deciding what to do with PS files on okular, seems strange, eh, since PS is so old and unchanging one would think it's a solved problem. At the moment we are using libgs instead of calling the gs binary to render the files but there are some things i am not sure, here is the list of pros and cons of using libgs.

* Using a library seems the right thing to my programmer mind
* We don't have to interact with gs using non-portable X properties like kghostview does
* We don't have to write the images to disk and then load them like ligature does

* Everyone (kghostview/evince/ligature) uses the gs binary
* libgs is not much widespread among distro packages, although that is improving and okular using it would probably "fix it"
* if libgs crashes it takes down the whole process
* libgs API is not what one would like it to be

So anyone out there that has the magic solution?

Of course, testers and constructive comments are more than welcome for the ghostscript okular backend, actually for all okular parts :-)


Vinay said...

As far as crashing of libgs is concerned, you can always you a proxy process and then use IPC for communication to that proxy process. So, when libgs crashes, you can restart it again!

like nspluginviewer does for plugins.

pipitas said...

I'd like to support all your "pros"! And argue against some of your "cons":

--> "Everyone (kghostview/evince/ligature) uses the gs binary"

Hehe... everyone (kghostview/evince/ligature) will soon be following okular's lead if you switch to libgs... :-)

--> "libgs is not much widespread among distro packages, although that is improving and okular using it would probably 'fix it'"

libgs *will* soon be much more widespread than it is now:

* did you know that artofcode LLC (the company of Raph Levien developing Ghostscript) a year ago announced the release of their leading edge version 8.54 under GPL license for the first time (instead of AFPL license as was the case with leading edge Ghostscript releases previously)?

* did you know this step paved the way for the chance to an eventual merge of ESP Ghostscript with GPL Ghostscript?

* did you know that ESP Ghostscript in the meanwhile indeed has being merged with GPL Ghostscript?

* did you know that GPL Ghostscript's current version is 8.57 and was released about 3 weeks ago?

* did you know the ESP & GPL Ghostscript merger is already completed?

* did you know that libgs is now much easier to build, and that Mandriva already ships libgs by default, and that the next LSB example packages for "distro independent Ghostscript" will build libgs by default?

Go for libgs with okular! It will help a lot more maintainers and packagers to do the same...

1052 said...

That the library is not widespread would simplify improving its API for a future version, wouldn't it?

Albert Astals Cid said...

@vinay: Yeah, but then i have to think how to pass back the data, then again using nonportable X hacks, etc etc.

@pipitas: Thanks for the support

@1052: Right, i'll see if i get enough mood to write the libgs guys

mentor said...

What pipitas and 1052 said.