Resize if image is bigger than a specific size
See original GitHub issueWith ImageMagic you can run:
mogrify -resize '800x800>' *
Which will resize a file only if its width OR height is bigger than 800. The image’s original aspect ration will also be maintained. Is there such a “shortcut” option for sharp? Or, should I call metadata()
first and then resize accordingly, depending on what I get?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (9 by maintainers)
Top Results From Across the Web
How to resize an image in HTML? - ImageKit.io
One of the simplest ways to resize an image in the HTML is using the height and width attributes on the img tag....
Read more >Resize Images Proportionally While Keeping The Aspect Ratio
Our first choice is to set only one size property, either width or height , the browser will automatically calculate the size of...
Read more >How to Resize and Make Images Larger without Losing Quality
First, you need to enter your desired image size in the 'Set new size' field by defining the width and height.
Read more >How do I auto-resize an image to fit a 'div' container?
To resize an image proportionally, you have to set either the height or width to "100%", but not both. If you set both...
Read more >Change the size of a picture, shape, text box, or WordArt
If you want to stretch, shrink, or just change the size of a picture (or shape), use the sizing handles or for more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sharp().withoutEnlargement().resize(800, 800)...
deprecated max() for { fit: sharp.fit.inside }.