Skip to content

Commit

Permalink
fix inverted Col/Row check (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago authored Dec 21, 2022
1 parent 6b4aa8e commit ea7623b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 4.1.5 (2022-12-20)

* Fix inverted col/row check when doing window read of a non WarpedVRT dataset

# 4.1.4 (2022-12-16)

* add `rio_tiler.mosaic.mosaic_point_reader` function to create Point value from multiple observation
Expand Down
4 changes: 2 additions & 2 deletions rio_tiler/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def read(
(row_start, row_stop), (col_start, col_stop) = window.toranges()
if (
min(col_start, row_start) < 0
or row_stop >= dataset.width
or col_stop >= dataset.height
or col_stop >= dataset.width
or row_stop >= dataset.height
):
boundless = True

Expand Down
Binary file added tests/fixtures/no_geo2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions tests/test_io_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

PREFIX = os.path.join(os.path.dirname(__file__), "fixtures")
NO_GEO = os.path.join(PREFIX, "no_geo.jpg")
NO_GEO_PORTRAIT = os.path.join(PREFIX, "no_geo2.jpg")
GEO = os.path.join(PREFIX, "cog_nonearth.tif")


Expand Down Expand Up @@ -89,6 +90,11 @@ def test_non_geo_image():
im = src.feature(poly)
assert im.data.shape == (3, 1100, 1100)

with warnings.catch_warnings():
with ImageReader(NO_GEO_PORTRAIT) as src:
img = src.tile(5, 2, 3)
assert not img.mask.all()


def test_with_geo_image():
"""Test ImageReader usage with Geo Images."""
Expand Down

0 comments on commit ea7623b

Please sign in to comment.