Conversation
radarhere
reviewed
Oct 2, 2026
radarhere
force-pushed
the
fix/pdf-save-all-transparency-object-ids
branch
from
October 2, 2026 03:46
cbe1619 to
98036ad
Compare
Member
|
Thanks, nice catch. I've pushed a commit to add a comment and rename the test. |
radarhere
enabled auto-merge (squash)
October 2, 2026 03:48
This file contains hidden or 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
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.
Changes proposed in this pull request:
_savereserves an extra object ID for an SMask wheneverim.mode == "P" and "transparency" in im.info, but it checks that once per image, against the current frame, and then reserves the same number for every frame. For a GIF with transparency, the first frame is P with transparency and the later frames are RGBA, sosave_all=Truereserves objects that are never written. They stay in the xref table with offset 0.On
main, objects 9 and 10 have offset 0.PdfParser.read_indirect()raises "indirect object definition different than expected" for both, andqpdf --checkwarns "object has offset 0". With this change, every object reads back andqpdf --checkis clean.The extra ID was added in a70ea82 ("Write P transparency as SMask"). Letting
write_obj(None, ...)allocate the ID means the count can no longer disagree with what is written.