In getimagesize, the parameter path is incorrect. after uploading an image, the new file name is images/xxx.jpg. however, to use this file for both the front and back ends, I will convert it to the root path.
/Guest/images/xxx.jpg so that I can call this image anywhere. However, when using getimagesize to obtain image information during scaling, you can use images/xxx.jpg, but an error is returned when using/guest/images/xxx.jpg.
Warning: getimagesize (/guest/images/xxx.jpg) [function. getimagesize]: failed to open stream: No such file or directory in
Why? I don't want to change the path.
Reply to discussion (solution)
The path is incorrect. why not paste the following in ...?
The path is incorrect. why not paste the following in ...?
In is followed by getimagesize. the number of rows in this function is incorrect,
However, it is correct to use it, that is, an error occurred while using getimagesize.
Images/xxx.jpg physical (file system) path, based on the current directory
/Guest/images/xxx.jpg is the path in the unified resource location (url), based on the website root
The getimagesize must be a physical path.
Images/xxx.jpg physical (file system) path, based on the current directory
/Guest/images/xxx.jpg is the path in the unified resource location (url), based on the website root
The getimagesize must be a physical path.
This is troublesome. Is there any function to convert a uniform path to a physical path?
$ _ SERVER ['document _ root']. '/guest/images/xxx.jpg'
$ _ SERVER ['document _ root']. '/guest/images/xxx.jpg'
I learned another trick. thank you.