-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify pdf image output. #15175
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
Simplify pdf image output. #15175
Conversation
@@ -1455,26 +1431,26 @@ def _writePng(self, data): | |||
buffer.seek(length, 1) | |||
buffer.seek(4, 1) # skip CRC | |||
|
|||
def _writeImg(self, data, height, width, grayscale, id, smask=None): | |||
def _writeImg(self, data, id, smask=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever actually pass in a grayscale image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do pass single-channel images (for alpha). As for actual grayscale I don't know (see #12871 for the similar thing in postscript), but this PR doesn't change that behavior anyways.
What is the benefit of inlining? To me this looks more cluttered now. The original |
For me this made #15193 easier to write (even though strictly speaking it is orthogonal) -- as things stand it is a bit annoying to have to go through multiple places to track the shapes of the arrays involved. |
I would be happier with that 😃. |
sure, done |
Let _writeImg infer image size and grayscaleness from the data itself.
shape.
preliminary work towards #15165.
PR Summary
PR Checklist