Bug 694950

Summary: set_compression_method(): unsupported mode 10
Product: GhostPCL Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: PCL interpreterAssignee: Henry Stiles <henry.stiles>
Status: NOTIFIED LATER    
Severity: enhancement CC: htl10
Priority: P1 Keywords: bountiable
Version: unspecified   
Hardware: PC   
OS: Linux   
Customer: 190 Word Size: ---
Bug Depends on: 694978    
Bug Blocks: 694082    
Attachments: correct rendering.

Description Marcos H. Woehrmann 2014-01-14 09:12:56 UTC
The customer reports that the attached file generates the following message:

  set_compression_method(): unsupported mode 10


The file is too large to attach; it can be found in casper:/home/support/694950
Comment 1 Marcos H. Woehrmann 2014-01-14 09:15:32 UTC
I'll try plotting this file on my DesignJet later today.
Comment 2 Hin-Tak Leung 2014-01-14 11:21:11 UTC
There is already a bug filed for mode 10 support, with a smaller test file.
Comment 3 Marcos H. Woehrmann 2014-01-14 15:40:02 UTC
My HP DesignJet 2500CP does not print this file correctly either, none of the images are printed, instead large black rectangles appear at 3 places on the page.
Comment 4 Henry Stiles 2014-01-17 12:10:15 UTC
I've made this an enhancement - we aren't likely to look at this soon without HP precedent.  Hin-Tak can you provide a pointer to the other bug for compression mode 10?
Comment 5 Hin-Tak Leung 2014-01-17 13:31:20 UTC
(In reply to comment #4)
... Hin-Tak can you provide a pointer to the other bug
> for compression mode 10?

The other bug is "Bug 694082 - new raster compression mode". I made that depends on this one when I commented a few days ago.

The other one in 694082 might be easier - at least, since I generated the test file. It is the usual tiger, so you'll know when you get it right; OTOH, it requires implementing a newer set compression method. Marcos said his printer doesn't print this one in 694950 so it won't be obvious until one has almost completed the work.

I tried quickly stubbing mode10, hoping this one in 694950 would behave like 694082 (i.e. write some rubbish where the images should be), but none comes out; so it appears there is some HP-GL/2 PCL pass-through complication in this one as well.

FWIW, the CLJ3600 vendor-unique raster code is supposed to be a variant of mode
10. ( http://bugs.ghostscript.com/show_bug.cgi?id=694082#c1 ) .

On a different matter, most of pxl's image decompression streams (and so is sjpegd.c, and some of the other sj* etc in the main?), but none of the PCL's uncompress* does? Also was rather curious that sjpx_openjpeg.c implements the stream interface but actually doesn't stream, and instead buffer the whole thing(?) before decompressing.
Comment 6 Hin-Tak Leung 2014-01-20 13:50:43 UTC
Both of the files turns out to be somewhat not-straight-forward. This (bug 694950) requires an explicit -r<resolution> to render the raster at all, and at size A0, it isn't suitable for viewing while testing with improvements, but must render to say, png, etc which takes a bit longer to do. The other one (bug 694082) requires implementing a newer set compression method command; also, the incoming data is supposed to be of KRGB, with a mode-9 black plane and a mode-10 RGB plane. There doesn't seem to be existing code for coping with KRGB, or recombining two planes of different depth/color?

OTOH, I think I have a handle on this. It would fairly substantial effort though, essentially involves supporting two new classes of somewhat related printers; probably no less than the CLJ3600 effort, but I won't know until I go a bit deeper.

I found and fixed a segfault in the mode 9 decompress code while looking at this.
Will file.
Comment 7 Hin-Tak Leung 2014-01-23 23:42:42 UTC
Created attachment 10610 [details]
prototype code rendering at 1200dpi and downscale=8 and shrink further to 13%

prototype code rendering at 1200dpi and downscale=8 and shrink further to 13%.

I can't do 12.5% in my image viewer ; but this is -r1200, tiffscaled24, downscaler=8 then further to 13%.
Comment 8 Hin-Tak Leung 2014-01-23 23:43:52 UTC
Created attachment 10611 [details]
prototype code rendering at 600dpi and downscale=8 and shrink further to 26%

prototype code rendering at 600dpi and downscale=8 and shrink further to 26%

Just for comparison.
Comment 9 Hin-Tak Leung 2014-01-23 23:48:45 UTC
(In reply to comment #3)
> My HP DesignJet 2500CP does not print this file correctly either, none of
> the images are printed, instead large black rectangles appear at 3 places on
> the page.

No... It is actually one single background image intended to be rendered at 1200 dpi. If the printer mis-renders it at 300 it would be 3 bands. (at -r600 it is a few more bands).

See attachments.

Marcos: I can't seem to mark them private. Please do so.
Comment 10 Hin-Tak Leung 2014-01-23 23:52:53 UTC
(In reply to comment #4)
> I've made this an enhancement - we aren't likely to look at this soon
> without HP precedent...

Henry: I have something that sort of sees the beginning of it. (see attachment 10610 [details] for its current state). Do you want to discuss with Miles to make this another project similar in size to the CLJ3600's?
Comment 11 Hin-Tak Leung 2014-01-24 00:02:47 UTC
FWIW, the image itself says it is a HP designjet 4000 test print.
Comment 12 Hin-Tak Leung 2014-01-24 07:23:09 UTC
Created attachment 10613 [details]
wrong rendering at 300dpi and downscale=8 and shrink further to 52%

wrong rendering at 300dpi and downscale=8 and shrink further to 52%

This shows 3 bands. I wonder if that's how it appears on Marcos' designjet 2500.

Needs to mark private also.
Comment 13 Hin-Tak Leung 2014-01-28 05:43:25 UTC
Created attachment 10621 [details]
correct rendering.

Correct rendering, I think, from:

pcl6 -J'@PJL SET RESOLUTION = 1200' -r24 -lRTL -sDEVICE=png16m -o a.png ...

This should obsolete attachment 10610 [details], and possibly also 10611 10613 . (Don't have that option, despite the fact I uploaded those). and also need private.

The pdfwrite output, A0_Dinos_hwc_best_cad_on.pdf (66544396 byte), at full resolution, is too large so I leave in my home directory on casper for those who want to look at the fine details. I think it is done, since I cannot see anything obviouslty wrong with it.

Also, bug 694773 needs to be re-opened, but I filed another equivalent one, bug 694978, anyway, with a public-source test file.
Comment 14 Hin-Tak Leung 2014-01-29 02:05:24 UTC
attachment 10621 [details] still needs to be marked private, although I suspect it came from HP's paper/color calibration kit for that printer, judging from the content, and not particularly sensitive.
Comment 15 Hin-Tak Leung 2014-02-04 10:06:09 UTC
left "pcl6-win32-mode9and10.exe" in my home dir in casper.

Needs to run with
    pcl6 "-J@PJL SET RESOLUTION = 1200" -lRTL ...

I have also a few other test files (tiger's & the usual window test pages).
Comment 16 Hin-Tak Leung 2014-10-22 15:23:29 UTC
Now that 9.15 is out, I tried and made a new accumulated misc-work-in-progress binaries -
ghostscript-9.15-77-gb72bd31_9.15-29-ga236e68-win32-bins.zip , 
and (same thing, just extracted)
pcl6-9.15-77_29.exe

in my casper home.

It still needs "-J@PJL SET RESOLUTION = 1200" but that's filed as bug 694978. There is nothing else to be done as far as the test file here is concerned; but my original motivation was bug 694082 which is more complicated than this and still does not work. So I guess I'll post the fix and close this if/when the resolution thing in bug 694978 is addressed, or if bug 694082 moves along.