Skip to content

Commit

Permalink
fix: make sure to forward scale and offset in info even if offset is 0 (
Browse files Browse the repository at this point in the history
#687)

* fix: make sure to forward scale and info even if offset is 0

* update changelog
  • Loading branch information
vincentsarago authored Mar 22, 2024
1 parent a224859 commit 8dee95e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# 6.4.3 (2024-03-22)

* make sure `scale` and `offset` are set in `Info` even when `offset=0.` or `scale=1.0` (https://github.com/cogeotiff/rio-tiler/pull/687)

# 6.4.2 (2024-03-22)

* better account for coverage in statistics (https://github.com/cogeotiff/rio-tiler/pull/684)
Expand Down
2 changes: 1 addition & 1 deletion rio_tiler/io/rasterio.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _get_descr(ix):
"height": self.dataset.height,
"overviews": self.dataset.overviews(1),
}
if self.dataset.scales[0] and self.dataset.offsets[0]:
if self.dataset.scales[0] != 1.0 or self.dataset.offsets[0] != 0.0:
meta.update(
{"scale": self.dataset.scales[0], "offset": self.dataset.offsets[0]}
)
Expand Down

0 comments on commit 8dee95e

Please sign in to comment.