add_image_size landscape or portrait

What you’re asking for is functionally equivalent to scaling images to fit within a bounding square of each size, so could be achieved with this:

add_image_size('big_xxl', 4500, 4500);
add_image_size('big_xl', 3300, 3300);
add_image_size('big', 2100, 2100);
add_image_size('medium', 1250, 1250);

Consider a landscape image that is 5000×500. These rules will generate images scaled to 4500, 3300, 2100 and 1250 wide.

For a portrait image of 500×5000, these rules will generate images scaled to 4500, 3300, 2100 and 1250 high.

error code: 523