I need to resize images in php using GD to a fixed size but maintain the orientation (portrait/landscape), these are:
portrait: 375 x 500px
landscape: 500 x 375px
Everything I have tried always ignores the orientation and makes them all landscape.
Can anyone help?
Check the width and height of the incoming image. If the width is wider than the height, make your target size 500 x 375, otherwise make it 375 x 500. Then run the resize code with those target dimensions.