forked from python-pillow/Pillow
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Compare combined data to saved JPEG #1
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We already support streamtype=2 to skip producing JPEG tables, but streamtype=1, which skips everything but the tables, was never implemented. The streamtype=1 stub code dates to Git pre-history, so it's not immediately clear why. Implement the missing support. jpeg_write_tables() can't resume after a full output buffer (it fails with JERR_CANT_SUSPEND), so it might seem that Pillow needs to pre-compute the necessary buffer size. However, in the normal case of producing an interchange stream, the tables are written via the same libjpeg codepath during the first jpeg_write_scanlines() call, and table writes aren't resumable there either. Thus, any buffer large enough for the normal case will also be large enough for a tables-only file. The streamtype option isn't documented and this commit doesn't change that. It does add a test though.
2a5eac0
to
4d7372b
Compare
Thanks, the suggestions and refactor LGTM! I've done some additional refactoring on top (including eliminating the temporary file) and pushed back to the original PR. |
bgilbert
pushed a commit
that referenced
this pull request
Nov 25, 2023
Do not assign new fp attribute to image when closing
bgilbert
pushed a commit
that referenced
this pull request
Dec 24, 2023
Add tests for glyph alpha blending
radarhere
pushed a commit
that referenced
this pull request
Jul 26, 2024
Added SupportsArrayInterface
radarhere
pushed a commit
that referenced
this pull request
Jul 26, 2024
radarhere
pushed a commit
that referenced
this pull request
Jul 26, 2024
Do not import numpy.typing unless TYPE_CHECKING
radarhere
added a commit
that referenced
this pull request
Jul 26, 2024
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggestions for python-pillow#7491
I've also restructured the test code, which you may have different thoughts about, so feel free to only use part of this.