Skip to content

float values mangled by scrub() with clean_pages enabled (via a bug in the underlying mupdf "clean" function) #4991

@johnkw

Description

@johnkw

Description of the bug

Float values mangled by scrub() with clean_pages enabled. The save() with clean enabled also does this.

This only seems to occur in certain directions. I managed to pare this down to a very small input PDF.

Repro in python:
n = pymupdf.Document(stream=open('in.pdf','rb').read()) ; n.save('out.pdf', no_new_id=True, clean=True)

Then:

in.pdf

$ diff -aU0 in.pdf out.pdf | cat -e | grep ' 75 '
-116.8 9.66 3.2 75 re$
-120.8 9.66 0.8 75 re$
-133.6 9.66 0 75 re f Q$
+q 116.8 9.66 3.199997 75 re 120.8 9.66 .80000308 75 re 133.6 9.66 0 75 re f Q$

In this case 3 of the floats are mangled, but others are fine.

PyMuPDF version

1.26.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    not a bugnot a bug / user error / unable to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions