Giter VIP home page Giter VIP logo

Comments (8)

vseventer avatar vseventer commented on June 16, 2024

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.

emmtte avatar emmtte commented on June 16, 2024

Ok thanks it's working

from sharp-cli.

emmtte avatar emmtte commented on June 16, 2024

Hi,
with new version --max flag not working anymore

from sharp-cli.

vseventer avatar vseventer commented on June 16, 2024

@ManuCart What's the exact command you are using? This should still work as expected.

from sharp-cli.

emmtte avatar emmtte commented on June 16, 2024

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.

vseventer avatar vseventer commented on June 16, 2024

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.

emmtte avatar emmtte commented on June 16, 2024

OK, thanks for your help

from sharp-cli.

KasparEtter avatar KasparEtter commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.