We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
System: OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch) CPU: (4) x64 AMD EPYC 7T83 64-Core Processor Memory: 2.57 GB / 15.11 GB Container: Yes Shell: 4.4.12 - /bin/bash Binaries: Node: 12.22.12 - /usr/local/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 6.14.16 - /usr/local/bin/npm npmPackages: sharp: ^0.30.7 => 0.30.7
resize the picture while ensuring that the content of the picture is not lost.
const image = sharp(buff); const { width, height, } = await image.metadata(); const limit = 2173; if (Math.min(width, height) > limit) { image.resize(width < height ? { width: limit } : { height: limit }); buff = await image.jpeg({ quality: 100 }).toBuffer(); }
before resize: https://sigma-temp.oss-cn-shanghai.aliyuncs.com/temp_image/20241106-102659.jpg
after resize: https://sigma-temp.oss-cn-shanghai.aliyuncs.com/temp_image/20241106-102719.jpg
The text was updated successfully, but these errors were encountered:
Node: 12.22.12 - /usr/local/bin/node sharp: ^0.30.7 => 0.30.7
Please ensure you're using the latest version of sharp with an active version of Node.js.
If you're still having problems, please provide complete, standalone, minimal code and sample image that allows someone else to reproduce.
Sorry, something went wrong.
@yunmc Were you able to make any progress with this? If you still require help, please provide the requested information.
No branches or pull requests
Possible bug
What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?System:
OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (4) x64 AMD EPYC 7T83 64-Core Processor
Memory: 2.57 GB / 15.11 GB
Container: Yes
Shell: 4.4.12 - /bin/bash
Binaries:
Node: 12.22.12 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 6.14.16 - /usr/local/bin/npm
npmPackages:
sharp: ^0.30.7 => 0.30.7
What is the expected behaviour?
resize the picture while ensuring that the content of the picture is not lost.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Please provide sample image(s) that help explain this problem
before resize: https://sigma-temp.oss-cn-shanghai.aliyuncs.com/temp_image/20241106-102659.jpg
after resize: https://sigma-temp.oss-cn-shanghai.aliyuncs.com/temp_image/20241106-102719.jpg
The text was updated successfully, but these errors were encountered: