I have a script that uploads an image but first it resizes the image before upload and again to create a thumbnail.
Right now it has a fixed landscape width and height but I realized that some of my uploads will have a longer height. How can I modify my code to make the width fixed but the height will adjust regardless of a landscape or portrait orientation. Here is the parts of the code:
function makeThumbnails($updir, $img){
$thumbnail_width = 560;
$thumbnail_height = 432; ----------------------> This needs to change regardless of orientation
....
.....
$new_image = imagecreatetruecolor($thumbnail_width, $thumbnail_height);
imagecopyresampled($new_image, $old_image, $dest_x, $dest_y, 0, 0, $new_width,
$new_height, $original_width, $original_height);
}