# vtk.js: reading gzipped, binary STLs with vtkSTLReader

**URL:** https://discourse.vtk.org/t/vtk-js-reading-gzipped-binary-stls-with-vtkstlreader/6134
**Category:** Support
**Created:** [July 5, 2021, 10:24am UTC](https://discourse.vtk.org/t/vtk-js-reading-gzipped-binary-stls-with-vtkstlreader/6134 "2021-07-05T10:24:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aerogt3](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@aerogt3](https://discourse.vtk.org/u/aerogt3)
#### Post date: [July 5, 2021, 10:24am UTC](https://discourse.vtk.org/t/vtk-js-reading-gzipped-binary-stls-with-vtkstlreader/6134/1 "2021-07-05T10:24:23Z")

</div>

Hi,

I’m using vtk.js to read in and display locally stored STL files in the browser, which so far is working great for binary STLs. It works for reading/displaying remotely stored files as well, but the file size can be quite big.

```auto
var read = vtkSTLReader.newInstance();
read.setUrl( stl_url , { binary:true }).then( update.bind(2, i, map), vdErrHandler.bind(2, i) ) ;

```

Gzipping binary STLs gives me files which are ~half the size, so I am curious if such files can be read in with vtk.js? Any sort of hints in how to do so? I’ve looked into the source code, but I don’t have enough of a software background to understand it well enough. The following command yields no console warnings/errors, but also does not load any files. Anyone have any tips/advice? Or is this perhaps not a supported functionality?

```auto
read.setUrl( stl_url.gz , { compression:'gz', binary:true }).then( update.bind(2, i, map), vdErrHandler.bind(2, i) ) ;

```

---

<div class="post-metadata">

### Author: ![aerogt3](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@aerogt3](https://discourse.vtk.org/u/aerogt3)
#### Post date: [July 5, 2021, 11:16am UTC](https://discourse.vtk.org/t/vtk-js-reading-gzipped-binary-stls-with-vtkstlreader/6134/2 "2021-07-05T11:16:30Z")

</div>

Ok, through testing different methods, it seems ASCII STL can be loaded as gzip, by simply specifying compression:‘gz’. Is it a bug that this compression flag doesn’t work for binary files? Or perhaps user error in how I am setting the compression and binary options?

```auto
read.setUrl( stl_ascii_url.gz , { compression:'gz' }).then( update.bind(2, i, map), vdErrHandler.bind(2, i) ) ;

```

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [July 5, 2021, 6:44pm UTC](https://discourse.vtk.org/t/vtk-js-reading-gzipped-binary-stls-with-vtkstlreader/6134/3 "2021-07-05T18:44:44Z")

</div>

probably the `decompression` pass may not be implemented for the binary branch.
