Comments (8)
Just add the --max flag, that should do exactly what you want.
On Wednesday, May 11, 2016, Emmanuel CHARETTE [email protected]
wrote:
Hi,
I need to resize an image with 2048px maximum hight or 2048px maximum
width.
How to do this with command line?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1
Mark
from sharp-cli.
Ok thanks it's working
from sharp-cli.
Hi,
with new version --max flag not working anymore
from sharp-cli.
@ManuCart What's the exact command you are using? This should still work as expected.
from sharp-cli.
Before I used
sharp --verbose --max --width 2048 --height 2048 --withoutEnlargement -o "$FILE" "$FILE"
But now I have problems with width and height and output files.
Why so many changes?
from sharp-cli.
Your new command should be:
sharp -i $FILE -o $OUTFILE resize 2048 2048 --max --withoutEnlargement
, or
cat $FILE | sharp resize 2048 2048 --max --withoutEnlargement > $OUTFILE
.
You can still use the old version of the CLI by installing 0.7.0, but I recommend updating to the latest version. This latest version is up to date with the full sharp API, is more stable, and takes the order of operations into account (e.g. resize then rotate is different from rotate then resize).
from sharp-cli.
OK, thanks for your help
from sharp-cli.
A note to future readers: --max
has been removed in version 1.8.0. You can achieve the same now with --fit inside
(also in combination with --withoutEnlargement
).
from sharp-cli.
Related Issues (20)
- Resize by percentage HOT 2
- Remove people's data from the git history HOT 1
- Update `sharp` dependency to `v0.28` to support `AVIF` format
- Overwriting the input files failes in Node v16.4.1 HOT 1
- Does not Install on ARM64 M1 Apple Silicone HOT 2
- Specifying quality changes PNG file format to ISO Media HOT 4
- CPU usage low... HOT 3
- Option to delete original? HOT 3
- How to specify background/border color for `extend`? HOT 5
- Support for composite multiple images HOT 5
- NPM flags 3 moderate severity vulnerabilities upon install HOT 3
- Proposal: Add `--animated` Global Option HOT 2
- Add support PPM files HOT 7
- avif output ext wrong HOT 2
- Input file specification on windows - Backslash HOT 6
- Possible to add output option to buffer HOT 2
- sharp-cli vs sharp
- How to rasterize SVGs on PNG with specific width/height? HOT 4
- Greyscale conversion is not working HOT 6
- Installation does not work on Manjaro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharp-cli.