Bug 692354 - Horizontal white lines displayed across rendered PDF
Summary: Horizontal white lines displayed across rendered PDF
Status: NOTIFIED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-18 18:48 UTC by Anurag Garg
Modified: 2011-10-02 02:31 UTC (History)
1 user (show)

See Also:
Customer: 516
Word Size: ---


Attachments
Sample PDF which exhibits the problem (251.00 KB, application/pdf)
2011-07-18 18:48 UTC, Anurag Garg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anurag Garg 2011-07-18 18:48:50 UTC
Created attachment 7687 [details]
Sample PDF which exhibits the problem

When the attached PDF is rendered by MuPDF, horizontal white lines are displayed across it.
Comment 1 Ken Sharp 2011-07-19 20:17:02 UTC
Increasing priority as this is a commercial customer issue. Added customer number.
Comment 2 Robin Watts 2011-07-26 14:07:35 UTC
I have a fix for this locally, but it will adversely affect the rendering of bitmap based type3 fonts. I am hunting for a way to fix one without affecting the other...
Comment 3 Robin Watts 2011-07-26 19:41:23 UTC
A fix for this issue has been committed as:

commit 93701ab27b4d50f5d27da43f34d432e1963ce337
Author: Robin Watts <Robin.Watts@artifex.com>
Date:   Tue Jul 26 16:09:55 2011 +0100

    Fix bug 692354: Horizontal white lines in images.

    The problem is due to abutting images showing gaps between them.
    These gaps are due to a combination of rounding errors, and anti-aliasing
    effects on the edge of images.

    The solution is to selectively 'grid fit' images.

    If an image is part of a type 3 font, we do NOT want to grid fit it, as
    this is where the sub pixel positioning makes a huge difference.

    If an image is displayed with alpha, then we don't want to grid fit it
    (as grid fitting will tend to make the edges of images overlap by 1
    pixel, and will hence produce nasty effects).

    Otherwise, we will grid fit; Grid fit in this sense is where we expand
    an image to completely fill the pixel grid that it touches (i.e. the
    extents for the image are expanded to pixel boundaries; no half full
    pixels are left around the edges).

    The only real change of note here is in how we detect that we are in a
    type 3 charproc; we add a new draw device creation function that we call
    in the type3 charproc case that sets a flag that the drawing functions
    can check.

If you have any problems with it, or would like to be sent a patch, please let us know. Thanks.