On the Internet under a picture-trimmed plug-in jquery.cropzoom.min.js, the function is very powerful, but also helped me prepare a php dynamic script, do not take much effort on the set. And it's pretty good to run. Crop + rotate picture, one key can be.
At first there was no problem, and then there was an inexplicable error. Detailed description is as follows:
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Warning: getimagesize (http://localhost/cms/uploadfiles/2010/08/24/133934.jpg) [function.getimagesize]: Failed to open STREAM:A connection attempt failed because the connected party did no properly after A respond of Time, or established connection failed because connected host has failed to respond. In d:/appserv/www/cms/test/test.php on line 3
Fatal error: Maximum execution time seconds exceeded into d:/appserv/www/cms/test/test.php on C5>3
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
See this error, I think is not getimagesize need server configuration What, because at home is OK, I immediately debug:
<?php $size =getimagesize ("http://localhost/cms/uploadfiles/2010/08/24/133934.jpg"); Var_dump ($size);?>
the results show quite normal :
x-powered-by:php/5.2.10 Zendserver
set-cookie:zenddebuggercookie=127.0.0.1%3a10137%3a0| | 084|77742d65|1003; path=/
Content-type:text/html
Array (7) {
[0]=>
Int (800)
[1]=>
Int (533)
[2]=>
Int (2)
[3]=>
String (width=) "height=" "533" "
["Bits"]=>
Int (8)
["Channels"]=>
Int (3)
[MIME]=>
String (Ten) "Image/jpeg"
Then ran the code directly on Apache (the web), and there was the same problem. So it should be related to the server. Later, with the mentality of speculation, the http://localhost/cms/uploadfiles/2010/08/24/133934.jpg changed to the relative address. /.. /uploadfiles/2010/08/24/133934.jpg Hey, that's it. It seems to be the picture when the remote loading, do not know how the getimagesize work, so there is no guessing. But if so, how can PHP directly get the size of a remote photo? Solving.