 <p>It isn't a server side issue, every smartphone can apply a different orientation to the camera images. When you receive the image you have to access to its metadata (exif data si the exact name) to verify its rotation and other properties. Then you should apply to the picture the transformations you need.</p> <p>This should be a good startpoint to read exif data with PHP: <a href="http://php.net/manual/en/function.exif-read-data.php" rel="nofollow">http://php.net/manual/en/function.exif-read-data.php</a></p>