Bug 691833

Summary: Error: /rangecheck in --image--
Product: Ghostscript Reporter: Juliano Bellinazzi Nequirito <ra995050>
Component: ImagesAssignee: Alex Cherepanov <alex>
Status: RESOLVED INVALID    
Severity: normal CC: ra995050
Priority: P4    
Version: 9.00   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description Juliano Bellinazzi Nequirito 2010-12-11 06:44:33 UTC
An old bug apparently reappeared in Ghostscript. It happens when a PDF page is send to be printed and it has an image (only image or text and image). If there are a range of pages, the printing process stops as soon as the page with the image is found. I'm using CUPS with pnm2ppd driver (for the HP Deskjet 820Cxi printer), and the problem happens with any PDF viewer.
    Here is a segment of the CUPS error log file when two pages are sent to the printer in one job. The first has no image and is, consequently, printed; the second has a small image, which causes the interruption:
-----------
New page: %%Page: 1 1

Found: %%BeginPageSetup
Inserting option code into "PageSetup" section.
Copying page 2...
pagew = 576.0, pagel = 720.0
bboxx = 0, bboxy = 0, bboxw = 612, bboxl = 792
PageLeft = 18.0, PageRight = 594.0
PageTop = 756.0, PageBottom = 36.0
PageWidth = 612.0, PageLength = 792.0
Wrote 2 pages...
New page found but previous not printed, print it now.
Found: %%Page: 2 2
--> Output goes directly to the renderer now.

(/usr/lib/cups/filter/pstops) exited with no errors.

Starting renderer with command: "gs -sstdout=%stderr  -dNOPAUSE -dPARANOIDSAFER -dBATCH -r600 -sDEVICE=ppmraw  -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -sOutputFile=%stdout -_ | pnm2ppa -v 820  --bw -F /etc/pnm2ppa.gamma_best --bi -B 2 -t 0 -b 0 -l 0 -r 0 -x 0 -y 0 -i - -o -"
Starting process "kid3" (generation 1)

-----------
New page: %%Page: 2 2
Found: %%Page: 2 2
--> Output goes to the FIFO buffer now.


Found: %%BeginPageSetup
Inserting option code into "PageSetup" section.
Flushing FIFO.

Closing renderer
Starting process "kid4" (generation 2)
Starting process "renderer" (generation 2)
JCL: %-12345X@PJL
<job data> 

GPL Ghostscript  9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
PAGE: 1 1
Discarding unused job-progress event...
Error: /rangecheck in --image--
Operand stack:
--dict:7/8(L)--
Execution stack:
%interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1798   1   3   %oparray_pop
Dictionary stack:
--dict:1157/1684(ro)(G)--   --dict:3/20(G)--   --dict:124/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript  9.00: Unrecoverable error, exit code 1
renderer exited with status 0
Read 4376 bytes of print data...
kid4 exited with status 0
kid3 finished
kid3 exited with status 0

(...)
Comment 1 Ken Sharp 2010-12-11 08:41:47 UTC
Priority above 4 are reserved for Artifex customers. 

Before we can work on this issue we will need an example file which exhibits the problem, and a Ghostscript command line which can be used to reproduce it.
Comment 2 Ray Johnston 2010-12-11 17:44:27 UTC
From a quick look at the logs, it looks like Page 2 is being sent to gs as
a standalone page. Some PS files don't actually have page independence,
so that may be the cause of the error. All we can do is guess until a file is
attached for Page 2.
Comment 3 Alex Cherepanov 2010-12-18 20:07:10 UTC
Juliano, thank you for using and testing Ghostscript.
Unfortunately, little can be done without a sample file.
Feel free attach your sample file and re-open this bug report at any time.