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

Using an IRect as clip parameter in Page.get_pixmap no longer works since 1.23.9 #3134

Closed
stijnvermeeren-swisstopo opened this issue Feb 6, 2024 · 2 comments
Labels
bug fix developed release schedule to be determined Fixed in next release

Comments

@stijnvermeeren-swisstopo

Description of the bug

In PyMuPDF version 1.23.9 and newer, an IRect is no longer taken into account when provided as the clip parameter for the Page.get_pixmap method. Providing a Rect still works.

How to reproduce the bug

import fitz

doc = fitz.Document()
page = doc.new_page()
page.get_pixmap(clip=fitz.Rect(0, 0, 100, 100)).save("test_rect.jpg")
page.get_pixmap(clip=fitz.IRect(0, 0, 100, 100)).save("test_irect.jpg")

Expected behavior / behavior with PyMuPDF 1.23.8
Two JPG images of size 100x100 are created.

Behavior with PyMuPDF 1.23.9 and 1.23.21
The image test_rect.jpg has size 100x100 but the image test_irect.jpg has size 595x842 (full page).

PyMuPDF version

1.23.21

Operating system

Linux

Python version

3.11

@JorjMcKie JorjMcKie added the bug label Feb 6, 2024
@julian-smith-artifex-com
Copy link
Collaborator

I have a fix in my tree.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in 1.23.23.

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

No branches or pull requests

3 participants