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

client-side pyramids/tiling documentation? #87

Open
sebastiangug opened this issue Dec 19, 2024 · 1 comment
Open

client-side pyramids/tiling documentation? #87

sebastiangug opened this issue Dec 19, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sebastiangug
Copy link

I'm trying to use this library to generate some pyramids on the client side -- paired with an endpoint that returns S3-compatible signed urls.

I can't seem to find much documentation on tiling with either sharp or wasm-vips, I know by default vips will use the file system to save tiles on directories, so that's not an option in the browser, which will bring some limitations later on, that's fine for my use-case.

My hope is to load the image from an input field then generate each tile -> upload it -> move on.

I was hoping on finding some examples that go a bit more into depth around the methods and options available for tiling.

I'm happy to contribute some documentation after I figure it out.

@kleisauke kleisauke added the question Further information is requested label Dec 23, 2024
@kleisauke
Copy link
Owner

wasm-vips doesn't currently support creating image pyramids with dzsave, as it's a bit tricky in Wasm since it requires more threads than the current threshold defined here:

// Enforce a fixed thread pool by default on web
ENV['VIPS_MAX_THREADS'] = {{{ PTHREAD_POOL_SIZE }}};

# libvips requires spawning at least VIPS_CONCURRENCY threads synchronously, with a minimum of 3 threads per
# pipeline. This count includes the two write-behind background threads used by `vips_sink_disc`. To support up to
# two concurrent pipelines, we need to double that number. Therefore, build with:
# `-sPTHREAD_POOL_SIZE='Math.max(navigator.hardwareConcurrency, 6)'`.

Additionally, libarchive also needs to be compiled to make this work.

I can't seem to find much documentation on tiling with either sharp or wasm-vips

The libvips documentation has a chapter explaining how to make image pyramids.
https://www.libvips.org/API/current/Making-image-pyramids.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants