Fix volume rendering texture 3d sample#506
Conversation
|
Just for background, when initially contributing the sample, I went with gz to also demonstrate how compression formats interact with archival compression such as gzip or brotli, and also out of concern for git repo size (hence use of bin-gz as extension to explicitly control when things decompress). However either way should be fine |
beaufortfrancois
left a comment
There was a problem hiding this comment.
The public/assets/img/volume/t1_icbm_normal_1mm_pn0_rf0.py file would also be need to be updated right as it generates a gzip file. See gzip_filename in af6432c
a20b507 to
a7fbc25
Compare
|
updated |
The files were changed from `.bin-gz` to `.gz` and then left to the browser to decompress. But that only happened to work because the local dev server served `.gz` files with `content-encoding: gzip` headers. Github didn't do this. Revert to using `.bin-gz` and manually decompressing with `DecompressionStream`
a7fbc25 to
99fdbe4
Compare
| const response = await fetch(dataPath); | ||
| const buffer = await response.arrayBuffer(); | ||
|
|
||
| const compressedBlob = await response.blob(); |
There was a problem hiding this comment.
Out of curiosity, why blob?
There was a problem hiding this comment.
because theoretically it uses less memory? The browser can stream the blob through the decompressor. It can't stream the arrayBuffer as it's required to have loaded the entire thing
The files were changed from
.bin-gzto.bin.gzand then leftto the browser to decompress. But, that only happened to work
because the local dev server served
.gzfiles withcontent-encoding: gzipheaders. Github doesn't do this.Revert to using
.bin-gzand manually decompressing withDecompressionStream..bin-gzseems better then.gzbecausemany servers are configured to treat files that end in
.gzspecially.