question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resize only if larger

See original GitHub issue
Would it be possible to add an option to performs the a resize command only if 
the original file is larger than the dimensions specified. i.e. similar to the 
ImageMagick / GraphicsMagick angle bracket use, e.g.

-size '200x200>'

Original issue reported on code.google.com by oliver.k...@gmail.com on 14 May 2011 at 8:57

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
GoogleCodeExportercommented, Jul 25, 2015
Hi,

if I want to get image's height and weight
the only way is:
final Thumbnails.Builder<File> src = Thumbnails.of(srcImage);
final BufferedImage bufferedImage = src.asBufferedImage();
System.out.println(bufferedImage.getHeight());
System.out.println(bufferedImage.getWidth());
?

:)

Original comment by song...@gmail.com on 17 Jan 2014 at 5:42

0reactions
coobirdcommented, May 31, 2020

Supersede with #152. (The automatically imported issues are a little hard to read…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

resize - Only shrink larger images using ImageMagick to a ratio
If you want ImageMagick to shrink your large images but keep small images untouched, use the ">" operator: convert -resize '180000@>' ...
Read more >
Use mogrify to resize large files while ignoring small ones
I think mogrify systematically rewrites the file, so your only hope is to filter the list first, as suggested by jippie.
Read more >
Resize images only if larger than target dimensions - HUGO
Is there a way to tell the .Resize method to only resize if the source image is smaller than the requested dimensions?
Read more >
Resize if image is bigger than a specific size #1075 - GitHub
With ImageMagic you can run: mogrify -resize '800x800>' * Which will resize a file only if its width OR height is bigger than...
Read more >
Shink image if width is larger than - ImageMagick
I would like to shrink the image if the width is larger than 460px. by that code it resizes all images to width...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found