Bug 98983 - one particular PDF file displays badly
Summary: one particular PDF file displays badly
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-03 14:40 UTC by Lionel Elie Mamane
Modified: 2016-12-09 15:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
problematic pdf file (6.72 MB, application/pdf)
2016-12-03 14:40 UTC, Lionel Elie Mamane
Details
wrong rendering in evince (105.64 KB, image/png)
2016-12-03 14:40 UTC, Lionel Elie Mamane
Details
correct rendering in xpdf (120.92 KB, image/png)
2016-12-03 14:41 UTC, Lionel Elie Mamane
Details
initialize CairoOutputDev::antialias (772 bytes, patch)
2016-12-07 16:57 UTC, Jason Crain
Details | Splinter Review

Description Lionel Elie Mamane 2016-12-03 14:40:16 UTC
Created attachment 128318 [details]
problematic pdf file

Using evince (Debian package) 3.22.1-2 used with libpoppbler-glib8 0.48.0-2 the attached PDF file displays as per the attached screenshot. By contrast, xpdf 3.03-17+b1 using libpoppler46 0.26.5-2+deb8u1 displays it fine.
Comment 1 Lionel Elie Mamane 2016-12-03 14:40:55 UTC
Created attachment 128319 [details]
wrong rendering in evince
Comment 2 Lionel Elie Mamane 2016-12-03 14:41:16 UTC
Created attachment 128320 [details]
correct rendering in xpdf
Comment 3 Albert Astals Cid 2016-12-05 14:28:07 UTC
Works fine here, any chance you can try builing poppler from source and trying the test apps?
Comment 4 Lionel Elie Mamane 2016-12-05 15:40:09 UTC
I built poppler 0.48.0 from the Debian package, and both qt4/tests/test-poppler-qt4 and qt5/tests/test-poppler-qt5 display the first page fine.
Comment 5 Lionel Elie Mamane 2016-12-05 15:48:35 UTC
And I cannot reproduce the issue in evince anymore... <shrug>
Comment 6 Jason Crain 2016-12-07 16:46:00 UTC
The ability to specify antialiasing was added to pdftocairo and CairoOutputDev (Bug #94977) but CairoOutputDev::antialias is not always initialized, so which antialiasing option gets used by evince can be unpredictable.  Also, cairo's CAIRO_ANTIALIAS_BEST does not work well.  Running "pdftocairo -png -antialias best input.pdf out" on the PDF in this bug and others produces incorrect rendering.  So, depending on whether during rendering CairoOutputDev::setContextAntialias is called, and depending on what value the memory allocation gods choose for CairoOutputDev::antialias, this bad rendering can be triggered.
Comment 7 Jason Crain 2016-12-07 16:57:26 UTC
Created attachment 128371 [details] [review]
initialize CairoOutputDev::antialias

This patch initializes CairoOutputDev::antialias so that CAIRO_ANTIALIAS_DEFAULT will be used unless pdftocairo or some other application sets it to another value.  This fixes the rendering in evince.
Comment 8 Jason Crain 2016-12-08 05:23:07 UTC
opened bug #99021 for cairo's font rendering not working with CAIRO_ANTIALIAS_BEST
Comment 9 Carlos Garcia Campos 2016-12-09 15:44:36 UTC
(In reply to Jason Crain from comment #7)
> Created attachment 128371 [details] [review] [review]
> initialize CairoOutputDev::antialias
> 
> This patch initializes CairoOutputDev::antialias so that
> CAIRO_ANTIALIAS_DEFAULT will be used unless pdftocairo or some other
> application sets it to another value.  This fixes the rendering in evince.

Good catch, pushed!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.