geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
878 stars 183 forks source link

Load geotiff without all decoder lib #265

Closed TomBor closed 2 years ago

TomBor commented 2 years ago

Is there a way to load geotiff with a selection of compression lib ? For example only LZW.

That's not always necessary to load all of them.

Thanks you for this great project.

constantinius commented 2 years ago

Hi @TomBor

Glad you like the project!

The current implementation loads the decoders asynchronously (see here for reference: https://github.com/geotiffjs/geotiff.js/blob/07aceb9598acc15930047d9a0fc8ae5ca1092cce/src/compression/index.js).

Bundlers like Webpack can now do a code splitting and create separate bundles for both the main body of code and each decoder. Also, when you want to use a specific decoder, only that decoder is loaded.

Does that solve your issue?

TomBor commented 2 years ago

Great! Thank you for the precision