Image Transforms: Is there a way to detect portrait or landscape?
The best way would be to use the Fit image transform.

Set the transform to 'Fit' and set both your width and height values to 1000px. That way the image will continue to scale until the first longest edge reaches 1000px.