Bug 692285 - phase shift in dot pattern -- very long image
Summary: phase shift in dot pattern -- very long image
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: master
Hardware: PC Windows 7
: P2 normal
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 19:55 UTC by Ray Johnston
Modified: 2011-11-25 04:20 UTC (History)
0 users

See Also:
Customer: 330
Word Size: ---


Attachments
dots.png (3.66 MB, image/png)
2011-06-16 19:55 UTC, Ray Johnston
Details
dots2.pdf (1.48 KB, application/pdf)
2011-06-17 14:48 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Johnston 2011-06-16 19:55:22 UTC
Created attachment 7598 [details]
dots.png

around line 33000 (+/- 1000) there is a phase shift that appears.

The command line used was:

gswin32c -r720 -sDEVICE=png16m -o dots.png dots.pdf

The image produced is 1417 pixels wide by 141732 lines

I see the first error at raster line 33249/33250 and this also occurs at
98953. The customer reports failure around 66,000 but I can't see these.
The location of the phase glitch seems to vary slightly with parameters
(the customer used tiff32nc and the error was in a different place).

Since this happens with the TIFF device and the png16m device, this is most
likely a graphics library issue, possibly related to clist use.
Comment 2 Ray Johnston 2011-06-16 19:57:43 UTC
Asking Robin to take a look.
Comment 3 Robin Watts 2011-06-17 14:48:17 UTC
Created attachment 7601 [details]
dots2.pdf

Even simpler file.

 gswin32c.exe -dMaxBitmap=10000 -r180 -sDEVICE=png16m -o dots.png dots2.pdf

produces a png file of 354x35433 in size, mostly blank. Scroll down to the bottom in your favourite viewer that can cope (I use ImageMagick Display), and you'll see a discontinuity across the small region of the rectangle that is still filled.

This corresponds (I believe) to the join between bands 10 and 11.

Going to step through the clist code now to see if I can understand where the error is coming from.
Comment 4 Robin Watts 2011-06-17 17:16:46 UTC
Fixed in:

commit 4ed123916f3f3373d5648011ea03c3cd969e00c1
Author: Robin Watts <robin@ghostscript.com>
Date:   Fri Jun 17 17:11:27 2011 +0000

    Fix for Bug 692285: phase shift in patterns in long image.

    The phase for a pattern mask was being held in a short, rather
    than in an int. Unsurprisingly this caused problems when the
    phase overflowed. Simple fix is to use an int instead.

    Cluster testing shows no changes.