-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Segmentation fault on .extract with some converted gif -> webp #3837
Comments
Thanks for reporting, I can reproduce this locally - here's the backtrace:
It looks like attempting to read animated WebP images sequentially (i.e. top to bottom) from libwebp isn't always playing nicely with sharp's multi-page extract/join logic. This will relate to the change in v0.32.0 to default to sequential read where possible. Luckily there's a quick fix for this - commit 655da11 will be part of v0.33.0. |
Updated to commit 655da11, issue still exists for me. Probably I've installed it correctly (removed node_modules and installed from scratch). What I'm missing? |
You'll need to add the |
Tried with |
The If you really want to try, you'll probably need to add a few other dependencies too e.g. |
Thanks for hint with build directory, now its working great |
v0.33.0 is now available, thanks for reporting this. |
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?System:
OS: Linux 6.5 Artix Linux
CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
Memory: 11.60 GB / 125.69 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 21.0.0 - /usr/bin/node
npm: 10.2.1 - /usr/bin/npm
pnpm: 8.10.0 - /usr/bin/pnpm
npmPackages:
sharp: ^0.32.6 => 0.32.6
What are the steps to reproduce?
Convert animated .gif to animated .webp. Save and load into sharp again, then run .extract
What is the expected behaviour?
No segmentation fault
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
await sharp('test.gif', {
animated: true,
}).extract({left: 0, top: 0, width: 50, height: 50}).toBuffer(); // no segfault
await sharp('test.gif', {
animated: true,
}).webp().extract({left: 0, top: 0, width: 50, height: 50}).webp().toBuffer(); // no segfault
const buffer = await sharp('test.gif', {
animated: true,
}).webp().toBuffer();
await sharp(buffer, {animated: true}).extract({left: 0, top: 0, width: 50, height: 50}).toBuffer(); // segfault
Please provide sample image(s) that help explain this problem
The text was updated successfully, but these errors were encountered: