-
Notifications
You must be signed in to change notification settings - Fork 663
Closed
Labels
Fixed in next releasebugfix developedrelease schedule to be determinedrelease schedule to be determined
Description
Description of the bug
I have a PDF with the following drawings:
q
15 w
0 1 1 0 0 0 cm
100 100 m
500 100 l
S
Q
q
15 w
100 100 m
500 100 l
S
Q
They are just a line stroke, with the difference that the first one has a cm operation, which flips the drawing along the diagonal. They both have a stroke of 15 (15 w).
When I use Page.get_drawings() and get the width (which is the stroke width), it returns a line width of 0 for the first one and 15 for the second. I expect both to have the same width.
I didn't look further than this, but it looks like the problem is the transformation with a negative determinant.
How to reproduce the bug
Run the following script:
import fitz
doc = fitz.open("stroke-repro.pdf")
for page in doc:
drawings = page.get_drawings()
for drawing in drawings:
print('width:', drawing['width'])With the following file:
Which givens the following output:
width: 0.0
width: 15.0
PyMuPDF version
1.24.5
Operating system
Windows
Python version
3.11
Metadata
Metadata
Assignees
Labels
Fixed in next releasebugfix developedrelease schedule to be determinedrelease schedule to be determined