disable PIL DecompressionBombError for large rasters in predict_tile#1326
Conversation
|
can u trigger GitHub Actions CI workflows? cc @henrykironde |
|
Nice work on the reproduction test! |
|
thank you @vickysharma-prog for you feedback. I went with the module-level override to preserve the current API. Since |
|
Thanks again for the feedback, @vickysharma-prog! I want to elaborate on the architectural reasoning behind the module-level approach for the maintainers' consideration. After evaluating a scoped approach (like a context manager or a per-function toggle), I found a few architectural realities that strongly reinforce the global module-level implementation:
Touching every call site introduces a massive maintenance burden.
Ultimately, this is a one-line, backward-compatible fix that aligns with the existing approach in @henrykironde @bw4sz , I am happy to make any adjustments if you'd prefer a different direction! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1326 +/- ##
==========================================
- Coverage 87.89% 86.97% -0.92%
==========================================
Files 20 24 +4
Lines 2776 3010 +234
==========================================
+ Hits 2440 2618 +178
- Misses 336 392 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


When processing large orthomosaics via
predict_tile, DeepForest triggers aPIL.Image.DecompressionBombError(or warning). This occurs because Pillow hardcodes a safety limit of ~89.5 million pixels to prevent DoS attacks, which standard drone imagery effortlessly exceeds.Technical Implementation
Image.MAX_IMAGE_PIXELS = Noneto the module initialization block insrc/deepforest/main.py.AI usage acknowledgement