php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15760 GetImageSize: Read Error!
Submitted: 2002-02-27 06:13 UTC Modified: 2002-02-27 14:11 UTC
From: mcclay at proqc dot com dot tw Assigned:
Status: Closed Package: GetImageSize related
PHP Version: 4.1.1 OS: Linux/Slackware 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mcclay at proqc dot com dot tw
New email:
PHP Version: OS:

 

 [2002-02-27 06:13 UTC] mcclay at proqc dot com dot tw
$x=GetImageSize("/some/dir");

In versions of PHP 4.0 and lower if the object of GetImageSize it would
not report an error. 

Just upgraded to 4.1.1 and now GetImageSize reports an
error if the object is just a directory and not a file.

Adding @GetImageSize takes care of the error.

The reason I am bothering to write this bug report is that
when I was trying to solve the problem I did a search at
Google and saw that hundreds of pages on the net have
this same problem, most likely many of them as a result
of upgrading. 

In fact, this is not a bug.  GetImageSize is reporting
an error if it can't find the file.  Unfortunately it's earlier
behavior allowed people to be lazy using this function. 

They could use an object composed of variables, one
being a directory and another a file.  If both are met,
the size array is returned, if not, nothing.  But now, if
not mean big "Read Error".

Russ McClay

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-27 14:11 UTC] sander@php.net
Known behaviour, clearly documented at http://www.php.net/manual/en/function.getimagesize.php
"If accessing the filename image is impossible, or if it isn't a valid picture, getimagesize() will return NULL and generate a warning."
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Apr 16 02:01:23 2021 UTC