diff --git a/src/zarr.cpp b/src/zarr.cpp index 211602b2..e33bc3b2 100644 --- a/src/zarr.cpp +++ b/src/zarr.cpp @@ -381,19 +381,19 @@ zarr::Zarr::get_meta(StoragePropertyMetadata* meta) const .width = { .writable = 1, .low = 32.f, - .high = -1.f, + .high = (float)std::numeric_limits::max(), .type = PropertyType_FixedPrecision }, .height = { .writable = 1, .low = 32.f, - .high = -1.f, + .high = (float)std::numeric_limits::max(), .type = PropertyType_FixedPrecision }, .planes = { .writable = 1, .low = 32.f, - .high = -1.f, + .high = (float)std::numeric_limits::max(), .type = PropertyType_FixedPrecision }, }, @@ -577,6 +577,8 @@ zarr::Zarr::set_chunking(const ChunkingProps& props, const ChunkingMeta& meta) props.height, (uint32_t)meta.height.low, (uint32_t)meta.height.high), }; + const auto hi = (uint32_t)(-1.f); + planes_per_chunk_ = std::clamp( props.planes, (uint32_t)meta.planes.low, (uint32_t)meta.planes.high); diff --git a/src/zarr.v3.cpp b/src/zarr.v3.cpp index 0356a242..a03eda0f 100644 --- a/src/zarr.v3.cpp +++ b/src/zarr.v3.cpp @@ -96,11 +96,11 @@ zarr::ZarrV3::get_meta(StoragePropertyMetadata* meta) const .is_supported = 1, .width = { .writable = 1, .low = 1.f, - .high = -1.f, + .high = (float)std::numeric_limits::max(), .type = PropertyType_FixedPrecision }, .height = { .writable = 1, .low = 1.f, - .high = -1.f, + .high = (float)std::numeric_limits::max(), .type = PropertyType_FixedPrecision }, .planes = { .writable = 1, .low = 1.f,