Rotation of image

Hello All,
I am encountering a problem while displaying profile picture on my website.
When i am uploading a landscape picture its looking fine but when i am upoading a portrait size, it is displaying as landscape only. How can i change that.

:

Let rotate it back to the right direction you want with GD PHP extension http://php.net/manual/en/function.imagerotate.php

That’s nowhere near enough information for anyone to be able to help.

My site is still in testing mode, so not online.

Here is the link to my original picture… http://www.buddiescolumn.com/crack/2.jpg

This is what i am getting after upload. after upload this is displaying with head in left and bottom in right.

My script to upload—

<?php

$fileName = $_FILES["uploaded_file"]["name"]; // The file name
$fileTmpLoc = $_FILES["uploaded_file"]["tmp_name"]; // File in the PHP tmp folder
$fileType = $_FILES["uploaded_file"]["type"]; // The type of file it is
$fileSize = $_FILES["uploaded_file"]["size"]; // File size in bytes
$fileErrorMsg = $_FILES["uploaded_file"]["error"]; // 0 for false... and 1 for true
$kaboom = explode(".", $fileName); // Split file name into an array using the dot
$fileExt = end($kaboom); // Now target the last array element to get the file extension
if (!$fileTmpLoc) { // if file not chosen
    echo "ERROR: Please browse for a file before clicking the upload button.";
    exit();
} else if($fileSize > 5242880) { // if file size is larger than 5 Megabytes
    echo "ERROR: Your file was larger than 5 Megabytes in size.";
    unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder
    exit();
} else if (!preg_match("/.(gif|jpg|png)$/i", $fileName) ) {
     // This condition is only if you wish to allow uploading of specific file types    
     echo "ERROR: Your image was not .gif, .jpg, or .png.";
     unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder
     exit();
} else if ($fileErrorMsg == 1) { // if file upload error key is equal to 1
    echo "ERROR: An error occured while processing the file. Try again.";
    exit();
}
$moveResult = move_uploaded_file($fileTmpLoc, "uploads/$fileName");
if ($moveResult != true) {
    echo "ERROR: File not uploaded. Try again.";
    unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder
    exit();
}
?>

We do not evaluate PHP code in this forum. Please render your code in a browser and copy the HTML for your page and paste that between [noparse]

 ... 

[/noparse] tags in a message. You could also post a screen shot showing what you see.

The image you have linked to is in landscape mode even though you tipped the camera up to get a portrate photo - unless there is an auto orientate function to read the EXIF data which is written into your photo; your upload or display script it will display it that way.

You would need to change your:

$moveResult = move_uploaded_file($fileTmpLoc, "uploads/$fileName"); 

To a GD or Imagemagick command to rotate then save the image.