Skip to content

Commit

Permalink
remove white space when passing rescale parameters for float32 value (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago authored Aug 23, 2021
1 parent f2c3725 commit 9fb0142
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Release Notes

## Next (TDB)
## 0.3.6 (2021-08-23)

### titiler.core

- fix morecantile related tests (https://github.com/developmentseed/titiler/issues/358)
- fix float parsing when datatype is float32 (https://github.com/developmentseed/rio-viz/issues/39)

### titiler.application

Expand Down
10 changes: 10 additions & 0 deletions src/titiler/core/tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def test_TilerFactory():
assert "postprocess;dur" in timing
assert "format;dur" in timing

response = client.get(
f"/tiles/8/87/48?url={DATA_DIR}/cog.tif&rescale=-3.4028235e+38,3.4028235e+38"
)
assert response.status_code == 200
assert response.headers["content-type"] == "image/jpeg"
timing = response.headers["server-timing"]
assert "dataread;dur" in timing
assert "postprocess;dur" in timing
assert "format;dur" in timing

response = client.get(
f"/tiles/8/87/48.tif?url={DATA_DIR}/cog.tif&expression=b1,b1,b1&return_mask=false"
)
Expand Down
2 changes: 1 addition & 1 deletion src/titiler/core/titiler/core/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class RenderParams(DefaultDependency):
def __post_init__(self):
"""Post Init."""
self.rescale_range = (
[tuple(map(float, r.split(","))) for r in self.rescale]
[tuple(map(float, r.replace(" ", "").split(","))) for r in self.rescale]
if self.rescale
else None
)

0 comments on commit 9fb0142

Please sign in to comment.