上传的图像文件有宽度和高度值切换,令人眼花缭乱

Here is the html client form:

<form action="http://www.roncherry.com/ppmama/pictest.php" method="POST"   enctype="multipart/form-data">
       File(JPG) to Upload: <input type="file" name="fnpic" />
       <input type='submit' value='Save to Servers' />
</form>    

Here is the action php server code:

if ($_FILES["fnpic"]["name"]) {
list($width, $height) = getimagesize($_FILES["fnpic"]["tmp_name"]);
echo 'sizes are w= ' . $width . ' h= ' . $height;
}

Before upload width is 478, height is 640.
After upload width is 640, height is 478.
Upload works only problem is the dimension values.
Any ideas?

The code you provided above is working correctly.. I just change the $_FILES["fnpic"]["tmp_name"] to the image location.

http://i.stack.imgur.com/EBNHJ.png

http://i.stack.imgur.com/dTNCM.png

Result:

sizes are w= 421 h= 516

You can refer to this post -> Get Image Height and Width as integer values?