Bug 25755 - Sample PDF works in pre-0.11.2 poppler, breaks in post-0.11.1
Summary: Sample PDF works in pre-0.11.2 poppler, breaks in post-0.11.1
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-21 22:46 UTC by Dennis Sheil
Modified: 2010-01-24 21:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Sample PDF where newer poppler versions can not see some text (181.16 KB, application/pdf)
2009-12-21 22:46 UTC, Dennis Sheil
Details
A reversion of the bad commit for the current code (2.86 KB, patch)
2009-12-22 07:38 UTC, Dennis Sheil
Details | Splinter Review

Description Dennis Sheil 2009-12-21 22:46:16 UTC
Created attachment 32239 [details]
Sample PDF where newer poppler versions can not see some text

Manuel Mourão reported in Ubuntu's bug tracker that a PDF he had was not working as some of the text in the PDF was not being displayed.  I have attached that PDF to this bug report.  He says he can read the PDF with xpdf but not Evince.  Evince is dependent on poppler, xpdf is not.

I did a number of tests, and various versions of evince linked against 0.11.1 and earlier poppler libraries worked in being able to see the specified text in this document.  Poppler 0.11.2 broke evince's ability to read the text.

I also used the epdfview program to look at the PDF, with it using the pre-0.11.2 and post-0.11.1 poppler libraries.  For the former it could see the specified text, for the latter it could not.

It looks like a code change in 0.11.2 broke poppler's ability to see this text, since poppler can see the text in 0.11.1.

By post-0.11.1 poppler being broken in this regard I mean every release from 0.11.2 to 0.12.2.  It is also broken in a compile I did of today's git branch ( git://git.freedesktop.org/git/poppler/poppler ).

The original reporter said he could view the missing text in Xpdf, and I can as well.  The changes in 0.11.2 removed poppler's ability to see the text.
Comment 1 Albert Astals Cid 2009-12-22 00:50:21 UTC
The problem is most likely in the cairo renderer backend than in the glib frontend, but yes i  can reproduce the problem.

Carlos?
Comment 2 Carlos Garcia Campos 2009-12-22 00:52:05 UTC
it works for me with current git master. 
Comment 3 Dennis Sheil 2009-12-22 02:06:55 UTC
I did a git bisect and tested commits between 0.11.1 and 0.11.2.  The commit that breaks it is ad26e34bede53cb6300bc463cbdcc2b5adf101c2 .  Prior to that commit the text is displayed (commit ee6b761a55baef4c3bbe4614b0c3b3d761a3111f and prior display the text).

I am using the Cairo 1.8.8 library on Ubuntu 9.10, as was the original Ubuntu bug reporter.  Cairo 1.8.8 appears to be the last stable Cairo library, although I do see there are newer development versions of Cairo.

The ad2...1c2 commit modified lines in the CairoOutputDev.cc file.  A git show after my bisect tests gave this information about the commit:

git show

commit ad26e34bede53cb6300bc463cbdcc2b5adf101c2
Author: Carlos Garcia Campos <carlosgc@gnome.org>
Date:   Sun Jul 26 18:36:06 2009 +0200
    [cairo] Use rectangle + clip instead of invert + tranform
    This is just for consistency of drawImage methods
Comment 4 Dennis Sheil 2009-12-22 04:31:17 UTC
Actually, close but not quite there.  512b2c654fd80c83b82e7adc828a478a18de17ab is the bad commit, ad26e34bede53cb6300bc463cbdcc2b5adf101c2 is the last good commit.
Comment 5 Dennis Sheil 2009-12-22 07:38:00 UTC
Created attachment 32245 [details] [review]
A reversion of the bad commit for the current code

As I said, 512b2c654fd80c83b82e7adc828a478a18de17ab is the bad commit which removes the functionality.  That commit was made on July 26, 2009.

I just grabbed poppler from git with the last commit being df0ccddb7f784b4a8564beda51b3047cb9e3611a (December 18, 2009).  The patch I put here rolls back the bad 512b...ab commit against this latest code (df0c...611a).  After installing this patch on df0c...611a, I can now see the deleted text.

I am not completely familiar with cairo and poppler and do not know all the reasons for the 512b...17ab commit.  What it appears like to me is poppler had some old hacky stuff in it as a workaround prior to Cairo coming out with the ability to do "cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);".  The old hacks were taken out, the new Cairo calls were put in.  And they were hacks on the poppler end - there's mallocing, lack of good error handling etc.  But the old code still works, and the 512b...17ab code ultimately does not.

My patch puts the old mallocing, bad error handling but working code back in as a child of the last commit (df0c...611a).  The goal I suppose would be to fix it so it is working, and then work to get the 512b...17ab code that implements cairo_pattern_set_extend() with CAIRO_EXTEND_PAD properly.

As I said, I don't fully understand poppler, cairo, gradient patterns etc.  If I have time I will look at this some more.
Comment 6 Albert Astals Cid 2009-12-22 12:41:39 UTC
As said fails here on git master, my cairo version is cairo-1.8.8-3.fc12.i686
Comment 7 Dennis Sheil 2010-01-24 21:11:20 UTC
This now works for me with evince-2.29.5, a 2 day old version of poppler (6825a219f0bc0ac6fd469fb8a6ebb86df774375f) and a 17 day old version of cairo (4204605813d93e7e2f0d8761e90a6dd6b8089dcb).

It looks like sometime between the June 16th, 2009 1.8.8 release of cairo, and the cairo git of 17 days ago, the code in cairo messing this up was fixed.  So this now works.


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.