Skip to content

Commit 9ad9727

Browse files
committed
Correctly include max zoom uncompressed size
1 parent fc0ed10 commit 9ad9727

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

bigtools/src/bbi/bbiwrite.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ pub(crate) fn write_zoom_vals<
11731173
let mut sections = vec![];
11741174
let handle = runtime.spawn(async move {
11751175
let (_, mut rcv, mut real_file) = rcv;
1176+
let mut max_uncompressed_buf_size = 0;
11761177
while let Some(r) = rcv.next().await {
11771178
let (data_write_future, mut data, sections_rcv) = r;
11781179

@@ -1193,7 +1194,7 @@ pub(crate) fn write_zoom_vals<
11931194

11941195
sections.push(sections_rcv.into_iter());
11951196
}
1196-
Ok((real_file, sections))
1197+
Ok((real_file, sections, max_uncompressed_buf_size))
11971198
});
11981199
zooms.push(handle);
11991200
}
@@ -1213,6 +1214,7 @@ pub(crate) fn write_zoom_vals<
12131214

12141215
// First, we can drop the writer - no more data
12151216
drop(first_zoom.0);
1217+
max_uncompressed_buf_size = max_uncompressed_buf_size.max(first_zoom.2);
12161218
let first_zoom_sections = first_zoom.1.into_iter().flatten();
12171219
let mut current_offset = first_zoom_data_offset;
12181220
let sections_iter = first_zoom_sections.map(|mut section| {
@@ -1235,7 +1237,8 @@ pub(crate) fn write_zoom_vals<
12351237

12361238
while let Some(zoom) = zip.next() {
12371239
let (zoom_fut, data) = zoom;
1238-
let (real_file, sections) = runtime.block_on(zoom_fut).unwrap()?;
1240+
let (real_file, sections, uncompress_buf_size) = runtime.block_on(zoom_fut).unwrap()?;
1241+
max_uncompressed_buf_size = max_uncompressed_buf_size.max(uncompress_buf_size);
12391242
let zoom_data_offset = file.tell()?;
12401243
// First, we can drop the writer - no more data
12411244
drop(real_file);

0 commit comments

Comments
 (0)