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.
Pro:
* 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
Con:
* 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 :-)
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!
ReplyDeletelike nspluginviewer does for plugins.
I'd like to support all your "pros"! And argue against some of your "cons":
ReplyDelete--> "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)?
http://advogato.org/person/raph/diary.html?start=411
* did you know this step paved the way for the chance to an eventual merge of ESP Ghostscript with GPL Ghostscript?
http://www.cups.org/espgs/articles.php?L390
* did you know that ESP Ghostscript in the meanwhile indeed has being merged with GPL Ghostscript?
http://www.cups.org/espgs/articles.php?L463
* did you know that GPL Ghostscript's current version is 8.57 and was released about 3 weeks ago?
http://sourceforge.net/project/showfiles.php?group_id=1897&package_id=108733
* did you know the ESP & GPL Ghostscript merger is already completed?
http://svn.ghostscript.com/ghostscript/branches/gs-esp-gpl-merger/
* 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...
That the library is not widespread would simplify improving its API for a future version, wouldn't it?
ReplyDelete@vinay: Yeah, but then i have to think how to pass back the data, then again using nonportable X hacks, etc etc.
ReplyDelete@pipitas: Thanks for the support
@1052: Right, i'll see if i get enough mood to write the libgs guys
What pipitas and 1052 said.
ReplyDelete