Online, etc. I am working overtime on Saturday and week to solve this problem. how can I get the length and width of the uploaded image?
List ($ width, $ height, $ type, $ attr) = getimagesize ('http: // 192.168.254.20/Public/images/0.jpg ');
Echo $ width;
Echo $ height;
Echo $ attr;
$ Img = imagecreatefromjpeg ("http: // 192.168.254.20/Public/images/0.jpg ");
Echo imagesx ($ img );
Echo "imagesy ($ img )";
Exit;
Neither method works and no data is output. The image path is correct. you can open the image.
Reply to discussion (solution)
The first method is acceptable, and you are suspected of having problems with your path.
List ($ width, $ height, $ type, $ attr) = getimagesize ('http: // avatar.csdn.net/1/9/2/1_mengfk000.jpg ');
Print_r ($ width); echo"
";
Print_r ($ height); echo"
";
Print_r ($ attr); echo"
";
Enable the php error prompt function.
If the image can be opened, at least the second type has output. The first is because getimagesize ('Http ://192.168.254.20/Public/images/0.jpg '); there is a space in front of the path.
print_r(getimagesize('http://avatar.csdn.net/1/9/2/1_mengfk000.jpg'));Array
(
[0] = & gt; 150
[1] => 150.
[2] => 2
[3] => width = "150" height = "150"
[Bits] => 8
[Channels] => 3
[Mime] => image/jpeg
)