Repository navigation
fix: properly reverse predictor for multi-band planar configuration tiff - #348
Merged
Merged
Conversation
Add test to ensure a multi-band, band-interleaved GeoTIFF with predictor=2 can be read properly. Using sample file at developmentseed/geotiff-test-data#78.
Planar configuration TIFFs should have reverse predictor applied using stride of 1, while chunky config keeps using stride=samples_per_pixel.
weiji14
commented
Oct 9, 2026
| # Regression test for | ||
| # https://github.com/developmentseed/async-tiff/issues/346 | ||
| "rasterio", | ||
| "uint16_3band_zstd_predictor2", |
Member
Author
There was a problem hiding this comment.
For reference, error before fix is applied from CI logs at https://github.com/developmentseed/async-tiff/actions/runs/37892107707/job/113695111009?pr=348#step:9:163:
FAILED tests/test_tiff.py::test_read_band_interleaved_tiff_window[rasterio-uint16_3band_zstd_predictor2] - AssertionError:
Arrays are not equal
Mismatched elements: 9514 / 12288 (77.4%)
Max absolute difference among violations: 298
Max relative difference among violations: 42.
ACTUAL: array([[[ 0, 2, 2, ..., 42, 42, 42],
[ 42, 44, 44, ..., 84, 84, 84],
[ 84, 86, 86, ..., 126, 126, 126],...
DESIRED: array([[[ 0, 2, 4, ..., 122, 124, 126],
[ 0, 2, 4, ..., 122, 124, 126],
[ 0, 2, 4, ..., 122, 124, 126],...
=================== 1 failed, 43 passed, 1 warning in 10.55s ===================
weiji14
marked this pull request as ready for review
October 10, 2026 00:30
weiji14
commented
Oct 10, 2026
Member
Author
There was a problem hiding this comment.
@geospatial-jeff, see if the changes here make sense to fix #346?
kylebarron
approved these changes
Oct 12, 2026
Member
Author
|
I'll give Jeff another day to respond before merging. |
Member
|
Thanks! |
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.
Ensure reverse predictor (2 and 3) is properly applied on a band/channel-wise basis (i.e. stride=1) for multi-band, planar configuration TIFFs.
TODO:
src/tile.rsFixes #346, patches #265.