1

So I've successfully used $ mogrify -resize 3000 to accomplish setting dimension on batches of images. What this yields me is exactly that- a group of images that have a 3000px width. The issue lies in vertical images that now have a vertical value larger than I would like.

My question is: Is there a solution that assesses the largest value (height or width) and then assigns the resize to that dimension.

Thanks in advance!

visyoual
  • 67
  • 6

1 Answers1

2

If you give both dimensions, it will resize until one dimension matches at least. So just use -resize 3000x3000. If you don't want to resize downwards you can add the suffix < so that only smaller images will grow to 3000, and larger images will be untouched (-resize '3000x3000<'). Similarly, suffix > to not resize upwards.

meuh
  • 49,672
  • 2
  • 52
  • 114
  • If I do that won't it force both to 3000? Im aiming to have one target dimension and the other to float within its current aspect ratio. – visyoual Jun 03 '20 at 16:25
  • 1
    @visyoual [No: “Resize will fit the image into the requested size. It does NOT fill, the requested box size.”](https://www.imagemagick.org/Usage/resize/#resize). (Unless you pass the suffix `!` to ignore the aspect ratio.) – Gilles 'SO- stop being evil' Jun 03 '20 at 16:38