Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better support for LZW #277

Merged
merged 5 commits into from
Oct 16, 2020
Merged

Add better support for LZW #277

merged 5 commits into from
Oct 16, 2020

Conversation

manzt
Copy link
Member

@manzt manzt commented Sep 8, 2020

I experimented with porting a pure Rust implementation of LZW to WASM: lzw-tiff-decoder. The bundle is kind of large (~50kb) but it's quick and sufficient for loading the default raw2ometiff output.

Ideally we could add the decoder to our code base under viv's getDecoder, but I had to make really minor changes to geotiff.js to support swapping a new wasm module. I opened an issue in geotiff a few days ago (geotiffjs/geotiff.js#172) related to making these changes.

I'm not sure if they will be open to the new decoder since it is large in comparison, but for something like avivator it would be really nice. Ideally we could code split the javascript/wasm for each decoder and only fetch when presented an image with a certain decoding.

lzw-decoder

@ilan-gold
Copy link
Collaborator

ilan-gold commented Sep 23, 2020

@manzt I hadn't realized this wasn't merged yet - do you want to merge this? I have LZW data generated for benchmarking if you'd like to benchmark the compression used as well. It could be interesting.

@manzt
Copy link
Member Author

manzt commented Oct 1, 2020

I opened an issue in geotiff (which needs a better name now): geotiffjs/geotiff.js#172,
but essentially I'd hope that consumers could define their own decoders without "paying the price" for all the built-ins.

I'm happy to move forward however, because the changes on my fork are fairly minimal and it adds better support for LZW.

@manzt manzt marked this pull request as ready for review October 1, 2020 13:47
@@ -110,7 +110,7 @@
"@luma.gl/core": "^8.2.0",
"@luma.gl/shadertools": "^8.2.0",
"fast-xml-parser": "^3.16.0",
"geotiff": "ilan-gold/geotiff.js#ilan-gold/string_fix",
"geotiff": "ilan-gold/geotiff.js#ilan-gold/viv_050_release",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the branch I was referring to - https://github.com/ilan-gold/geotiff.js/tree/ilan-gold/viv_050_release

It has both AbortController and the async-ify + LZW changes.

@manzt manzt merged commit bdd1c83 into master Oct 16, 2020
@manzt manzt deleted the manzt/lzw-wasm branch October 16, 2020 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants