Skip to content

get_pixmap method stuck on one page and runs forever #3125

Closed
@SofiiaChaban

Description

@SofiiaChaban

Description of the bug

I have a script that takes a PDF document URL, iterates through all the pages, generates a pixmap for each page, and uses it to create an image. However, the get_pixmap method gets stuck indefinitely on a particular page, and I'm unable to resolve it even after attempting to add timeouts.

How to reproduce the bug

Code snippet:

DPI = 300
pixmap = page.get_pixmap(matrix=fitz.Matrix(DPI/72, DPI/72))

The issue occurs on a specific page in the PDF file, and it's worth noting that other pages also contain numerous graphic elements.
Here is the page on which this method stucks (please, note that other pages have also a lot of graphic elements).
I would appreciate any insights into what might be causing this problem or any guidance on how to handle it, perhaps with the use of timeouts or alternative approaches.

image

PyMuPDF version

1.23.21

Operating system

MacOS

Python version

3.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions