Bug 689032 - new driver for ghostscript
Summary: new driver for ghostscript
Status: RESOLVED WONTFIX
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Other Driver (show other bugs)
Version: 8.56
Hardware: All All
: P4 enhancement
Assignee: Johannes Feigl
URL: http://bugs.debian.org/cgi-bin/bugrep...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-29 08:28 UTC by Johannes Feigl
Modified: 2010-04-25 22:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
patch for new driver (8.16 KB, patch)
2006-12-29 08:29 UTC, Johannes Feigl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Feigl 2006-12-29 08:28:06 UTC
hi ghostscript team,

this a not a bug report, it's a patch to have a new output-driver.

i've written a new driver for a mashine we are using in our company, called
"glassjet", is uses a special type of uncompressed tiff files. the
output-driver is very simple.

http://www.its-eng.com/printers_glassjet.asp
here you can see some informations about the mashine if you wanna know about
it.

i want to make it free available for everybody.
do you know to who i should send it that it will be added in the next
version?
(please make some cleanup)

you can find the patch for version 8.54 here:
http://bugs.debian.org/cgi-bin/bugreport.cgi/patch_gs-gpl_glassjet?bug=404017;msg=5;att=1

i've tested it and it works well.
thanks

regards,
johannes
Comment 1 Johannes Feigl 2006-12-29 08:29:09 UTC
Created attachment 2666 [details]
patch for new driver
Comment 2 Hin-Tak Leung 2006-12-30 13:49:04 UTC
Firstly, somebody else would say this: a modular design like ijs or opvp 
outside of ghostscript are preferred over compiled-in drivers. Please consider
re-writing it as ijs/opvp and just release it on your own like hpijs/gutenprint
etc.
 
Secondly, on general technical grounds, the use of printf() and fwrite()... 
I have not seen any of current gs's compiled in driver writes to stdout
directly. That aspect of the submitted patch is deeply wrong. 

As for the actual implementation... the hand-crafted hex-dump 
in glassjet_tiff_header() - the format the printer accepts looks like
uncompressed bitmap at fixed resolution with a custom header which just 
happens to be mostly tiff-like. it may be possible to wrap ghostscript's
pbm output with a shell/perl script or tuning tiffrle/tiffpack without 
the rle/pack part to achieve the same end.

All in all, I think the patch cannot be accepted, if only just based on
the printf()/fwrite() aspect alone. (I don't speak for the gs developers -
consider this a 3rd party opinion).
Comment 3 Johannes Feigl 2007-01-01 05:32:27 UTC
hi,

well it does not use printf(), it uses fprintf.
so the output is not going to stdout, ist going to the output-stream
"prn_stream". this means it could be stdout, a file, or e.g. a LPT
device (what you want and telling GS to use).

if you have a better idea instead of fprintf/fwrite please tell me.

the file format is a typical (uncompressed) tifffile, but the problem is,
that the header is fixed. the parameters must be in this order, otherwise
the tifffile does not work with the mashine.

i also thought about using order possibilities of creating such a file with
ghostscript, but i think this is a fasted way.

regards, johannes
Comment 4 Hin-Tak Leung 2007-01-01 20:01:58 UTC
I have an impression that gs has some macros to do with the output stream.

I think the driver can be written as a perl-(or python or shell) wrapper/filter
around the pbmraw device. 
Comment 5 Ray Johnston 2008-04-17 11:09:49 UTC
Please change this patch so that it adds into 'contrib' and contrib.mak as that
is where we put this type of less popular devices.
Comment 6 Johannes Feigl 2008-04-17 12:24:05 UTC
hi ray,

thanks for your (late) reply, i have to check again for the change for 'contrib'
and contrib.mak.

but anyway, the patch-like-working with fprintf etc is ok?

regards, johannes
Comment 7 Hin-Tak Leung 2009-01-18 23:25:12 UTC
Quite a few out-in-the-wild patches floating around ESP GS have gone into the
contrib directory in 8.60, so the climate has changed. OTOH, ijs, opvp, cups
raster are ways of maintaining a driver outside the ghostscript tree.  
Comment 8 Ray Johnston 2010-04-25 22:31:11 UTC
Closing this since Hin-Tak's suggestions for distributing this independently
of Ghostscript as a cups raster device, or an 'ijs' driver, both of which
can be distributed independently and do not require re-compilation of
Ghostscript make sense.

A third simple approach is to write the 'custom' output format by taking
something simple such as ppm or pbm in and then distributing a 'filter'
program that converts the file from Ghostscript makes sense.