Bug 48373 - annotation->boundary() can give completely wrong results
Summary: annotation->boundary() can give completely wrong results
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: qt4 frontend (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 01:34 UTC by Mark Summerfield
Modified: 2018-08-21 10:57 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
PDF that shows a poppler bug (77.47 KB, application/octet-stream)
2012-04-06 08:26 UTC, Mark Summerfield
Details

Description Mark Summerfield 2012-04-06 01:34:05 UTC
I am using Poppler with the Qt 4 interface.

Very occassionally when I call annotation->boundary() I get a rectangle that is completely wrong:

Poppler 0.18.2
QRectF(0.478033,0.459282 0.0294118x0.0238095) 
QRectF(0.220649,0.284354 0.0294118x0.0238095) 
QRectF(0.205549,0.149167 0.33766x0.676628) ########## WRONG
QRectF(0.449178,0.752604 0.0580752x0.0176349) 
QRectF(0.786647,0.521622 0.0154477x0.0101905) 
QRectF(0.508866,0.56928 0.0154477x0.0101905)

Poppler 0.19.2
QRectF(0.478033,0.459282 0.0294118x0.0238095) 
QRectF(0.220649,0.284354 0.0294118x0.0238095) 
QRectF(0.205549,0.149167 0.33766x0.676628) ########## WRONG 
QRectF(0.449178,0.752604 0.0580752x0.0176349) 
QRectF(0.786647,0.521622 0.0154477x0.0101905) 
QRectF(0.508866,0.56928 0.0154477x0.0101905)

In this case the annotation is for a deleted hyphen, so the rectangle should be very small (like the others).

In a 500 page document with hundreds of annotations this bug occurs on three pages.
Comment 1 Albert Astals Cid 2012-04-06 03:30:18 UTC
We'll need the pdf you have problems with.
Comment 2 Fabio D'Urso 2012-04-06 05:19:22 UTC
It might be the same issue as http://lists.freedesktop.org/archives/poppler/2012-March/008944.html (i.e. wrong bbox on pdf file)
If the whole file is too big, can you please extract at least the pages where it happens?
pdftk origfile.pdf cat <pageNumA> <pageNumB> <pageNumC> output newfile.pdf
Thank you
Comment 3 Mark Summerfield 2012-04-06 08:26:13 UTC
Created attachment 59590 [details]
PDF that shows a poppler bug

I have extracted just the three pages that are affected (out of 493 pages) and attached them.

BTW These pages generate the following errors when viewed with evince 2.30.3:

** (evince:2523): WARNING **: Unimplemented annotation: POPPLER_ANNOT_STRIKE_OUT, please post a bug report in Evince bugzilla (http://bugzilla.gnome.org) with a testcase.
Comment 4 Fabio D'Urso 2012-04-06 11:16:50 UTC
I assume that when you wrote
 QRectF(0.205549,0.149167 0.33766x0.676628) ########## WRONG
you were referring to annotation 9870b0a1-edba-42ee-aab1-50b2fab3b996 at page 1
 Type:                  HighlightAnnotation / StrikeOut
 Author:                Audrey Doyle
 Contents:              delete hyphen and close up
 Boundary rect:         [x=0.205549 y=0.149167 w=0.33766 h=0.676628]

The annotation is made of three quadrilaterals: the "-" at the top, the
"28<,2" in the bottom and a third one on "<" again (it is striked out twice).
So it makes sense for the bounding rect to cover that big area.
You can clearly see that they are the same annotation in acroread, because
clicking on one also selects the other ones, and they all show to the same
popup window.

If you want to extract the vertices of each quadrilateral you can use
HighlightAnnotation::highlightQuads().

Please reopen this bug if there's something I'm missing.
Comment 5 Mark Summerfield 2012-04-12 01:10:48 UTC
I've reopened this bug because although I accept that is isn't a bug in the code, the method you mention and the Quad struct aren't documented clearly enough for me to use.

I've read the source code for the Quad struct, but I don't understand the meaning of the QPointF points[4] array. I was expecting points[0] to be the top-left and points[2] to be the bottom-right but that seems wrong. Can you tell me what each point means please?
Comment 6 GitLab Migration User 2018-08-21 10:57:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/447.


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.