Skip to content

Conversation

@stefan6419846
Copy link
Collaborator

It took me rather long to debug

pypdf.errors.EmptyImageDataError: Data is 0 bytes, cannot process an image from empty data.

for a stream which looked completely fine. It turned out to be an invalid FlateDecode stream which we could not decode, thus converting an non-empty content stream into an empty one. With this PR, we at least forward the corresponding warning, although only once per warning type to not flood the application logs.

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (b6dedd3) to head (44fae08).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3579   +/-   ##
=======================================
  Coverage   97.16%   97.16%           
=======================================
  Files          56       56           
  Lines        9808     9813    +5     
  Branches     1790     1791    +1     
=======================================
+ Hits         9530     9535    +5     
  Misses        167      167           
  Partials      111      111           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 merged commit 3a82cd3 into py-pdf:main Dec 22, 2025
17 checks passed
@stefan6419846 stefan6419846 deleted the flate-empty branch December 22, 2025 10:33
stefan6419846 added a commit that referenced this pull request Jan 9, 2026
## What's new

### Security (SEC)
- Improve handling of partially broken PDF files (#3594) by @stefan6419846

### Deprecations (DEP)
- Block common page content modifications when assigned to reader (#3582) by @stefan6419846

### New Features (ENH)
- Embellishments to generated text appearance streams (#3571) by @PJBrs

### Bug Fixes (BUG)
- Do not consider multi-byte BOM-like sequences as BOMs (#3589) by @stefan6419846

### Robustness (ROB)
- Avoid empty FlateDecode outputs without warning (#3579) by @stefan6419846

### Documentation (DOC)
- Add outlines documentation and link it in User Guide (#3511) by @mainuddin-md

### Developer Experience (DEV)
- Add PyPy 3.11 to test matrix and benchmarks (#3574) by @rassie

### Maintenance (MAINT)
- Fix compatibility with Pillow >= 12.1.0 (#3590) by @stefan6419846

[Full Changelog](6.5.0...6.6.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant