ENH: add width, height, and data_size properties to ImageFile#3881
Open
itisar-345 wants to merge 9 commits into
Open
ENH: add width, height, and data_size properties to ImageFile#3881itisar-345 wants to merge 9 commits into
itisar-345 wants to merge 9 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3881 +/- ##
=======================================
Coverage 97.86% 97.87%
=======================================
Files 57 57
Lines 10738 10761 +23
Branches 2006 2011 +5
=======================================
+ Hits 10509 10532 +23
Misses 127 127
Partials 102 102 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Jun 22, 2026
stefan6419846
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR. I have added some remarks to the proposed changes.
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.
Previously, inspecting an image's dimensions or size required fully decoding it via .image or .data, even if the caller only wanted to
filter out images that are too large to process.
ImageFile now exposes:
All three are read directly from the PDF stream header/raw bytes and require no image decoding, so they remain cheap even for large or numerous images.
.data and .image continue to be populated eagerly as before; this change is purely additive and does not alter existing behavior.