Bug 326207

Summary: Search algorithm finds a result for "valuesas" when the real text is "values as"
Product: [Applications] okular Reporter: Albert Astals Cid <aacid>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: jaanvajakas
Priority: NOR    
Version: 0.17.60   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 4.13.0
Attachments: The said pdf

Description Albert Astals Cid 2013-10-18 14:47:40 UTC
Searching for "valuesas" in the attached pdf yields a result when it should actually return none.
Comment 1 Albert Astals Cid 2013-10-18 14:49:27 UTC
Created attachment 82927 [details]
The said pdf
Comment 2 Jaan Vajakas 2014-02-15 13:17:49 UTC
After the recent introduction of the feature of using libkscreen, the behavior is also dependent on the display DPI since the layout recognition algorithm rounds coordinates to integers at 100% resolution. With the said PDF, the bug is reproducible e. g. at 72 x 72 dpi.

I posted a patch on KDE Review Board. The patch also removes dependence of layout analysis on display DPI.
Comment 3 Albert Astals Cid 2014-02-15 14:03:27 UTC
Did you assign that patch to the okular group?
Comment 4 Albert Astals Cid 2014-02-15 14:04:01 UTC
Yes you did, ignore me :D
Comment 5 Albert Astals Cid 2014-02-25 22:59:52 UTC
Git commit a80922d45e66605075a2838ee8836cfe8219bfe7 by Albert Astals Cid, on behalf of Jaan Vajakas.
Committed on 25/02/2014 at 22:57.
Pushed by aacid into branch 'master'.

Improve XY Cut layout recognition code

It was a simple bug in the XY Cut layout recognition code that made it too eager to see columns everywhere.
Also removed the dependence of the layout analysis algorithms on the display DPI (introduced by the recently added feature of using KScreen) to make their behavior more predictable and reproducible.
Related: bug 331090
FIXED-IN: 4.13.0
REVIEW: 115759

M  +45   -31   core/textpage.cpp
M  +147  -101  tests/searchtest.cpp

http://commits.kde.org/okular/a80922d45e66605075a2838ee8836cfe8219bfe7