get_pixmap throws "Invalid bandwriter header dimensions/setup" error #3989
-
It happens when I use clip param. Code sample to reproduce import fitz
def process_annotations():
annotated_by_user = fitz.open("file.pdf")
p0 = annotated_by_user[0]
broker_rect = fitz.Rect(0.220947265625, 2913.936279296875, 14.62109375, 2921.13623046875)
print(f"is rect valid: {broker_rect.is_valid}") # returns true
pix_manually_annot = p0.get_pixmap(clip=broker_rect)
pix_manually_annot.save("manually_annot.png")
if __name__ == "__main__":
process_annotations() I'd share file privately, if possible, if it has to do anything with it. |
Beta Was this translation helpful? Give feedback.
Answered by
JorjMcKie
Oct 24, 2024
Replies: 1 comment 1 reply
-
There seems to be a plausi check missing : |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rashboldb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be a plausi check missing :
not (clip & page.rect).is_empty
must be ensured!