Bug #54723 [Com]: getimagesize() incorrectly identifies files as ICO which aren't
| From: | qing0088 at hotmail dot com | Date: | Mon, 29 Aug 2011 08:21:14 +0000 |
| Subject: | Bug #54723 [Com]: getimagesize() incorrectly identifies files as ICO which aren't | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163052@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54723&edit=1
ID: 54723
Comment by: qing0088 at hotmail dot com
Reported by: don at smugmug dot com
Summary: getimagesize() incorrectly identifies files as ICO
which aren't
Status: Closed
Type: Bug
Package: GetImageSize related
Operating System: CentOS 5.5
PHP Version: 5.3.6
Assigned To: scottmac
Block user comment: N
Private report: N
New Comment:
http://www.officialpackersjerseyshop.com/ Green
Bay Packers Jerseys
http://www.officialpackersjerseyshop.com/green-bay-packers-jerseys-aj-hawk-jersey-c-11_17.html A.J.
Hawk Jersey
http://www.officialpackersjerseyshop.com/green-bay-packers-jerseys-aaron-rodgers-jersey-c-11_13.html Aaron
Rodgers Jersey
Previous Comments:
------------------------------------------------------------------------
[2011-05-13 07:07:18] scottmac@php.net
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2011-05-13 07:06:51] scottmac@php.net
Automatic comment from SVN on behalf of scottmac
Revision: http://svn.php.net/viewvc/?view=revision&revision=310980
Log: Fixed bug #54723 - getimagesize() doesn't check the full ico signature and misreports mpg
files
------------------------------------------------------------------------
[2011-05-12 19:13:40] don at smugmug dot com
Grr. Instead of "are uploaded" that should read "are passed to getimagesize()".
Sorry about that.
------------------------------------------------------------------------
[2011-05-12 19:12:45] don at smugmug dot com
Description:
------------
When certain types of files are uploaded, including .MPGs, getimagesize()
incorrectly identifies them as ICOs with a MIME type of
'image/vnd.microsoft.icon'.
I suspect certain files probably have embedded icons in them, which is what PHP is
detecting and reporting, but the actual file isn't an ICO.
A ~500K sample file can be found here:
http://www.smugmug.com/img/video/problem/php-getimagesize.mpg
Expected result:
----------------
I'd expect FALSE to return, since this isn't a picture and isn't a valid type PHP
knows about.
Actual result:
--------------
It returns this array:
array(0 => 45,
1 => 82,
2 => 17,
3 => 'width="45" height="82"',
'bits' = 65023,
'mime' = 'image/vnd.microsoft.icon');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54723&edit=1