-
Notifications
You must be signed in to change notification settings - Fork 930
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
ImageWriter save FLATE_DECODE image as BMP makes the output file corrupt #916
Comments
Hi @dotrunghieu96, Thanks for the bug report and the corresponding PR. Could you share a PDF and some code that you use to reproduce this bug? That will allow me to understand the impact of your suggested change better. |
Hi @pietermarsman, this is the file that I used In code, first I was parsing the LTObjects via pages
Then parse the LTObjects
In
The problem here is that the images in the PDF are FLATE_DECODE, but ImageWriter saved them as So I moved FLATE_DECODE to a higher priority so that the _save_bytes() method is used first, and saved the image as ".jpg" which have the saved images perfectly viewable. |
Let me know if the issue is still there for you, and we can reopen this issue. In that case, could you specify what you mean by "corrupt"? |
Yup, extracting .bmp doesn't work. If this check is bypassed, extracted .bmp is corrupted.
|
Bug report
Thanks for finding the bug! To help us fix it, please make sure that you
include the following information:
A description of the bug:
ImageWriter priortized BMP over FLATE_DECODE so some image in my PDF is saved as bmp directly, which caused them to corrupt.
Steps to reproduce the bug. Try to minimize the number of steps needed.
Include the command and/or script that you use. Also include the PDF that
you use.:
If relevant, include the output and/or error stacktrace: Some FLATE_DECODE image is saved as bmp and cannot be opened
The text was updated successfully, but these errors were encountered: