Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method get_pixmap() make the program exit without any exceptions or messages #3727

Closed
Jianxinzhu-pact opened this issue Jul 25, 2024 · 10 comments
Labels
fix developed release schedule to be determined upstream bug bug outside this package

Comments

@Jianxinzhu-pact
Copy link

Description of the bug

When using page.get_pixmap() method, the program simply exits without any prompts(Both in Windows and Ubuntu) and cannot catch the exception.

How to reproduce the bug

Sample code:

import fitz
# can download the pdf from http://www.christtherock.org/wp-content/uploads/2020/03/7-Basic-Commands-Week-6.pdf
pdf_path = r"E:\Files\general-pdf\pdf\us\c63a\13e5\c63a13e590b5ec65994f84e179925e49.pdf"
doc = fitz.open(pdf_path)
for page in doc:
    try:
        page.get_pixmap(matrix = fitz.Matrix(2,2))
    except:
        print("error")

When using vscode debug the code, it exits when call _mupdf.fz_run_display_list.
When using the jupyter notebook, the kernal was crashed with the exitCode 3221225477.
In Ubuntu, it exit with a message Segmentation fault

PyMuPDF version

1.24.9

Operating system

Windows

Python version

3.9

@JorjMcKie
Copy link
Collaborator

Please always provide data for reproducing the problem!

@Jianxinzhu-pact
Copy link
Author

Jianxinzhu-pact commented Jul 26, 2024

@JorjMcKie You could find the sample pdf url in the sample code comment.
http://www.christtherock.org/wp-content/uploads/2020/03/7-Basic-Commands-Week-6.pdf

@JorjMcKie
Copy link
Collaborator

This is an upstream bug (MuPDF). I will transfer this bug to their issue management.

MuPDF issue link: https://bugs.ghostscript.com/show_bug.cgi?id=707925

@JorjMcKie JorjMcKie added upstream bug bug outside this package fix developed release schedule to be determined and removed example required Waiting for information labels Aug 1, 2024
@JorjMcKie
Copy link
Collaborator

The MuPDF team has developed a solution that fixes this issue.

@Jianxinzhu-pact
Copy link
Author

How can i update the pyMuPDF to fix this problem?

@Jianxinzhu-pact
Copy link
Author

How can i update the pyMuPDF to fix this problem?

Have built the pyMuPDF in local and process the PDF successful. Thanks.

@JorjMcKie
Copy link
Collaborator

Ah, I am glad to see that the solution does work for you. You obviously generated PyMuPDF using the MuPDF version from its GitHub repository?

@Jianxinzhu-pact
Copy link
Author

Ah, I am glad to see that the solution does work for you. You obviously generated PyMuPDF using the MuPDF version from its GitHub repository?

Yes. From this repo: https://github.com/ArtifexSoftware/mupdf

@julian-smith-artifex-com
Copy link
Collaborator

Reopening until we've made a release that includes the fix.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in 1.24.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix developed release schedule to be determined upstream bug bug outside this package
Projects
None yet
Development

No branches or pull requests

3 participants