Bug #74504 [Opn->Fbk]: getimagesize fails with relative path
| From: | requinix@php.net | Date: | Thu, 27 Apr 2017 07:18:39 +0000 |
| Subject: | Bug #74504 [Opn->Fbk]: getimagesize fails with relative path | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208816@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74504&edit=1
ID: 74504
Updated by: requinix@php.net
Reported by: dpfender44 at gmail dot com
Summary: getimagesize fails with relative path
-Status: Open
+Status: Feedback
Type: Bug
Package: GetImageSize related
Operating System: Windows
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
Works fine for me. Are you sure the working directory is what you think it is? You know it's
not necessarily the same directory that the current executing script is in, right?
echo getcwd() . "/" . $fpath;
Previous Comments:
------------------------------------------------------------------------
[2017-04-26 22:03:15] dpfender44 at gmail dot com
Description:
------------
If the path to the image file is relative to current directory (up a level), the file cannot be
found. Only a path from the current level and downward will work or using a full path from the very
top level. There is nothing in the documentation to say that this should not work.
Test script:
---------------
// current working directory is w:/xxx/admin
// images are in w:/xxx/pics
$fpath = '../pics/img.jpg';
$x = getimagesize($fpath);
// CANNOT FIND THE FILE
$fpath = 'w:/xxx/pics/img.jpg';
$x = getimagesize($fpath);
// RESULT is GOOD
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74504&edit=1