Bug 689507 - WTS is not working in 8.61. 8.54 worked fine.
WTS is not working in 8.61. 8.54 worked fine.
Status: RESOLVED WONTFIX
Product: Ghostscript
Classification: Unclassified
Component: General
8.60
PC Linux
: P4 major
Assigned To: Ray Johnston
Bug traffic
http://foo2zjs.rkkda.com/
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-10 06:24 PDT by Rick Richardson
Modified: 2011-01-10 19:56 PST (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
xxx-01-1.pbm.gz (33.85 KB, application/octet-stream)
2007-10-10 21:57 PDT, Marcos H. Woehrmann
Details
xxx-01-2.pbm.gz (38.44 KB, application/octet-stream)
2007-10-10 21:57 PDT, Marcos H. Woehrmann
Details
xxx-01-3.pbm.gz (33.51 KB, application/octet-stream)
2007-10-10 21:57 PDT, Marcos H. Woehrmann
Details
xxx-01-4.pbm.gz (153.45 KB, application/octet-stream)
2007-10-10 21:58 PDT, Marcos H. Woehrmann
Details
GSBIN=gs854 foo2lava-wrapper -c testpage.ps >xxx854.lava (320.50 KB, application/octet-stream)
2007-10-10 22:08 PDT, Rick Richardson
Details
GSBIN=gs861 foo2lava-wrapper -c testpage.ps >xxx861.lava (18.19 KB, application/octet-stream)
2007-10-10 22:10 PDT, Rick Richardson
Details
icc.usecie.ps (457 bytes, application/postscript)
2007-10-11 08:18 PDT, Marcos H. Woehrmann
Details
testpage.ps (17.63 KB, application/postscript)
2007-10-11 08:18 PDT, Marcos H. Woehrmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Richardson 2007-10-10 06:24:24 PDT
GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02)

WTS is not working in 8.61. 8.54 worked fine.  Build foo2zjs and install.

$ cd foo2zjs
$ foo2lava-wrapper -c testpage.ps >xxx
$ lavadecode -dxxx < xxx > lava.txt
$ eog xxx-01-4.pbm

All you get is ~10 equally spaced lines running horizontal.
Comment 1 Marcos H. Woehrmann 2007-10-10 09:40:07 PDT
I'm having trouble even getting foo2zjs to run with 8.54:

marcos@amd64:[167]% foo2lava-wrapper -c testpage.ps > xxx
AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
marcos@amd64:[168]% 

The xxx file isn't informative:

2345X@PJL JOB NAME="stdin"
2345X@PJL JOB USERNAME=""
2345X@PJL JOB TIMESTAMP="10/10/2007"
2345X@PJL JOB OSINFO="Linux/2.6.20-16-generic"
2345X@PJL ENTER LANGUAGE=LAVAFLOW

0S0G1200D1X1X
2345X
Comment 2 Marcos H. Woehrmann 2007-10-10 09:47:50 PDT
Ignore my last comment; I found the /var/log/lpr.log entries.  I had a missing environment variable, so 
ghostscript couldn't find any fonts (I normally run Ghostscript via an alias).
Comment 3 Marcos H. Woehrmann 2007-10-10 09:55:14 PDT
I'm not able to duplicate this.

Both gs8.54 and gs8.61 (r8283) produce what appear to me to be identical xxx-01-?.pbm files.

What revision of 8.61 are you running?  
Comment 4 Rick Richardson 2007-10-10 09:57:28 PDT
Ubuntu gs 8.61.
Comment 5 Rick Richardson 2007-10-10 10:27:06 PDT
View with eog (eye of gnome). Should be Redhat printer test page.

Ubuntu 8.61: GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02)
Comment 6 Rick Richardson 2007-10-10 21:15:14 PDT
$ svn co http://svn.ghostscript.com/ghostscript/trunk/gs
$ cd gs
$ ./autogen.sh
$ make; root make install
# mv /usr/local/bin/gs /usr/local/bin/gs861
$ GSBIN=gs861 foo2lava-wrapper -c testpage.ps >xxx
$ lavadecode -dxxx < xxx > lava.txt
$ eog xxx-01-4.pbm

Same result: horiz. lines.
Comment 7 Marcos H. Woehrmann 2007-10-10 21:52:25 PDT
I've tried the exact steps you posted, including downloading, compiling, and installing Ghostscript, and 
am still getting what I think is a good output (see one of the .pbm files attached).  Can you attach the xxx 
file that Ghostscript generates in the "foo2lava-wrapper -c testpage.ps >xxx" step?
Comment 8 Marcos H. Woehrmann 2007-10-10 21:57:15 PDT
Created attachment 3457 [details]
xxx-01-1.pbm.gz
Comment 9 Marcos H. Woehrmann 2007-10-10 21:57:38 PDT
Created attachment 3458 [details]
xxx-01-2.pbm.gz
Comment 10 Marcos H. Woehrmann 2007-10-10 21:57:53 PDT
Created attachment 3459 [details]
xxx-01-3.pbm.gz
Comment 11 Marcos H. Woehrmann 2007-10-10 21:58:05 PDT
Created attachment 3460 [details]
xxx-01-4.pbm.gz
Comment 12 Rick Richardson 2007-10-10 22:08:19 PDT
Created attachment 3461 [details]
GSBIN=gs854 foo2lava-wrapper -c testpage.ps >xxx854.lava
Comment 13 Rick Richardson 2007-10-10 22:10:46 PDT
Created attachment 3462 [details]
GSBIN=gs861 foo2lava-wrapper -c testpage.ps >xxx861.lava
Comment 14 Marcos H. Woehrmann 2007-10-10 22:15:30 PDT
Wow, that's just what you said it looks like.

How about capturing the output of Ghostscript before it's sent to foo2lava?  I did this by modifying the line in foo2lava-
wrapper:

sed 's#^[^/]*cupsPSLevel2#false#' | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
    -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
| foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
            -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
            -J "$LPJOB" -U "$USER" \
            $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG


to:

sed 's#^[^/]*cupsPSLevel2#false#' | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
    -sOutputFile=zzz $GAMMAFILE - >/dev/null) 3>&1 \
| foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
            -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
            -J "$LPJOB" -U "$USER" \
            $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG

Please attach the gzipped zzz file.

You might also confirm the /var/log/lpr.log line for Ghostscript looks like this:

  gs861 -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN 
Comment 15 Rick Richardson 2007-10-10 22:22:36 PDT
You probably didn't:

$ cd foo2zjs
$ make
$ ./getweb 2530
or
$ ./getweb all
$ sudo make install
Comment 16 Rick Richardson 2007-10-10 22:23:59 PDT
gs861 -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk -dCOLORSCREEN
 /tmp/icc20267.usecie.ps /tmp/icc20267.crd.ps /tmp/icc20267.selcrd.ps
Comment 17 Marcos H. Woehrmann 2007-10-10 22:40:48 PDT
You're right, I hadn't.  I'm doing that know and will let you know what I find.  BTW, which printer are you 
using for testing?
Comment 18 Rick Richardson 2007-10-10 22:47:00 PDT
I have KM 2530 DL, HP Color LaserJet 2600, Xerox 6110, KM 2300 DL.

All fail.

Don't know why.  gs8.54 works like a charm.

lavadecode, zjsdecode, qplddecode lets you play w/o a printer.
Comment 19 Rick Richardson 2007-10-10 22:49:39 PDT
Going to bed...
Comment 20 Marcos H. Woehrmann 2007-10-11 07:03:04 PDT
I'm now able to reproduce the problem: Ghostscript 8.60 (and later) fails and
Ghostscript 8.54 works. 
Comment 21 Marcos H. Woehrmann 2007-10-11 08:05:03 PDT
The first rev that fails is 8080. 
Comment 22 Marcos H. Woehrmann 2007-10-11 08:18:24 PDT
Created attachment 3464 [details]
icc.usecie.ps
Comment 23 Marcos H. Woehrmann 2007-10-11 08:18:46 PDT
Created attachment 3465 [details]
testpage.ps
Comment 24 Marcos H. Woehrmann 2007-10-11 08:25:15 PDT
Starting with r8080 Ghostscript generates an error when converting the attached
using WTS at high DPI values.  The error reported is:

  Error: /unknownerror in --showpage

The command line I used for testing:

  bin/gs -r600 -sDEVICE=pkmraw -sOutputFile=test.ppm icc.usecie.ps testpage.ps

Resolutions below 462 DPI work (on my system) and removing the icc.usecie.ps
(which turns on WTS) also works.  
Comment 25 Rick Richardson 2007-10-12 13:22:21 PDT
I'll need:

2400x1200 DPI
Comment 26 Rick Richardson 2007-10-13 10:51:11 PDT
$ svn -r 8080 update
U    src/gdevwts.c
U    src/gswts.c
U    src/gswts.h
U    src/gxdhtserial.c
Updated to revision 8080.
Comment 27 Rick Richardson 2007-10-14 02:44:50 PDT
    * Well Tempered Screening (WTS) works with ghostscript 8.54-8.57.
      It does not work with gs 8.15, 8.60 and 8.61.  So if you want 
      BEST COLORS, you'll have install gs 8.57.
	
	$ wget
"http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs857/ghostscript-8.57.tar.gz"
	$ tar zxf ghostscript-8.57.tar.gz
	$ cd ghostscript-8.57
	$ ./autogen.sh
	$ make
	$ su				OR $ sudo cp bin/gs /usr/bin/gs.foo
	# cp bin/gs /usr/bin/gs.foo

Comment 28 Rick Richardson 2007-10-15 17:19:33 PDT
wts)
    GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"

This is a workaround: -dMaxBitmap=500000000 (NOT MaxBitMap).

Comment 29 Ray Johnston 2010-10-01 20:36:56 PDT
WTS has several flaws, not the least of which is the performance.

Closing this since we will not be addressing this in favor of other screening
technology.
Comment 30 Rick Richardson 2011-01-10 14:34:52 PST
(In reply to comment #29)
> WTS has several flaws, not the least of which is the performance.
> 
> Closing this since we will not be addressing this in favor of other screening
> technology.

segfault on 8.71, too.

So, WTS is not the preffered screen.  What is, then?
Comment 31 Rick Richardson 2011-01-10 14:38:39 PST
FYI:
https://bugzilla.redhat.com/show_bug.cgi?id=668436
Comment 32 Rick Richardson 2011-01-10 15:34:12 PST
(In reply to comment #30)

> segfault on 8.71, too.

segfault on 9.00, too

Only one that works is in the SVN repo.
Comment 33 Ray Johnston 2011-01-10 17:52:28 PST
Thanks for testing with the SVN head. We will have a release coming out (9.01)
as close to Feb. 1 as we can manage, so this update will include the fix for
the WTS crash.

The problems with WTS are primarily that it seems to fall down on the halftone
generation for some angles when the lpi is high for the current resolution.

Michael Vrhel has developed a 'supercell' halftone generation program that
we will be moving toward, and while this is in the SVN in:
   toolbin/color/halftone/halfttoning/
the documentation is almost non-existent and we haven't really done much
testing with it, and it doesn't work with PostScript without changing the
binary format output to something compatible with PS. We are looking at all
of these issues.
Comment 34 Rick Richardson 2011-01-10 19:56:12 PST
(In reply to comment #33)
> Thanks for testing with the SVN head. We will have a release coming out (9.01)
> as close to Feb. 1 as we can manage, so this update will include the fix for
> the WTS crash.
> 
> The problems with WTS are primarily that it seems to fall down on the halftone
> generation for some angles when the lpi is high for the current resolution.
> 
> Michael Vrhel has developed a 'supercell' halftone generation program that
> we will be moving toward, and while this is in the SVN in:
>    toolbin/color/halftone/halfttoning/
> the documentation is almost non-existent and we haven't really done much
> testing with it, and it doesn't work with PostScript without changing the
> binary format output to something compatible with PS. We are looking at all
> of these issues.

Hmm.  I see.  But, I just read the doco GS 9.0 Color Management.  So, I can use,
say,
    gs900 -sOutputICCProfile=/usr/share/foo2qpdl/icm/samclp315-argyll-0.icm  ...
and get rid of the WTS completely?? Or no??