I have some folder containing vertical and horizontal images and I want resize image into smaller format and lower quality.

Some of them has format:

1. width = 3x, height = 2x - i.e. 3000x2000 or 1500x1000.
2. width = 2x, height = 3x - i.e. 2000x3000 or 1000x1500.

How can I express such command line for `convert` to convert them into two smaller formats with lower quality and resize:

1. width = 900, height = 600
2. height = 600, height = 900

How to make this command line working only for horizontal images `w > h`?

`convert *.jpg -resize 900x600 -quality 80 *.jpg`?

I can not use such syntaxes:

1. `convert *.jpg -resize 50% -quality 80 *.jpg` - all image can have differen widths.