-
Notifications
You must be signed in to change notification settings - Fork 510
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
extract_image returns an extension "flate" instead of "png" #2348
Labels
Comments
Confirmed. This is weird! |
JorjMcKie
added a commit
that referenced
this issue
Apr 17, 2023
We were returning arbitrary image type codes when reading the image binary from the PDF, e.g. "flate", even though they never would correspond to a meaningful image file extension. This fix catches type codes not corresponding to known image file extensions and cause such images to be converted to PNG images (via an intermediate Pixmap).
Closed
julian-smith-artifex-com
added a commit
to ArtifexSoftware/PyMuPDF-julian
that referenced
this issue
Apr 18, 2023
julian-smith-artifex-com
pushed a commit
to ArtifexSoftware/PyMuPDF-julian
that referenced
this issue
Apr 18, 2023
We were returning arbitrary image type codes when reading the image binary from the PDF, e.g. "flate", even though they never would correspond to a meaningful image file extension. This fix catches type codes not corresponding to known image file extensions and cause such images to be converted to PNG images (via an intermediate Pixmap).
julian-smith-artifex-com
added a commit
that referenced
this issue
Apr 18, 2023
julian-smith-artifex-com
pushed a commit
that referenced
this issue
Apr 18, 2023
We were returning arbitrary image type codes when reading the image binary from the PDF, e.g. "flate", even though they never would correspond to a meaningful image file extension. This fix catches type codes not corresponding to known image file extensions and cause such images to be converted to PNG images (via an intermediate Pixmap).
Fixed in PyMuPDF-1.22.1. |
julian-smith-artifex-com
added a commit
to ArtifexSoftware/PyMuPDF-julian
that referenced
this issue
Apr 25, 2023
This extends commit 3bae451, which fixed pymupdf#2348.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Plom, we have a unit test that
.jpeg
and.png
can be placed on a page and subsequently extracted withextract_image
. In 1.21.1 to 1.22.0, the jpeg test works but the png one broke. The return dict fromextract_image
has value"flate"
instead of"png"
for the "ext" key.Here is an MWE:
On PyMuPDF 1.21.1 the output is:
On PyMuPDF 1.22.0, the output is:
Is this intended change or a regression?
The text was updated successfully, but these errors were encountered: