Bug #65536 [NEW]: getimagesize() returning wrong value for IMG_PNG
| From: | hammadullahkhan at gmail dot com | Date: | Fri, 23 Aug 2013 23:23:29 +0000 |
| Subject: | Bug #65536 [NEW]: getimagesize() returning wrong value for IMG_PNG | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-181150@lists.php.net to get a copy of this message | ||
From: hammadullahkhan at gmail dot com
Operating system: windows
PHP version: 5.4.19
Package: PHP options/info functions
Bug Type: Bug
Bug description:getimagesize() returning wrong value for IMG_PNG
Description:
------------
---
From manual page:
http://www.php.net/function.getimagesize#refsect1-function.getimagesize-returnvalues
---
Hi,
Just noticed that getimagesize() is returning wrong value in case of PNG:
Array
(
[0] => 1125
[1] => 651
[2] => 3
[3] => width="1125" height="651"
[bits] => 8
[mime] => image/png
)
[2] => should return 4
As per:
gd.php line 1805
define ('IMG_PNG', 4);
Test script:
---------------
$imgInfo = getimagesize("test.png");
if ($imgInfo[2] == IMG_PNG)
{
echo "CONDITION SHOULD BE WORKING AS PER gd.php";
}
else
{
echo "CONDITION NOT WORKING";
}
Expected result:
----------------
CONDITION SHOULD BE WORKING AS PER gd.php
Actual result:
--------------
CONDITION NOT WORKING
--
Edit bug report at https://bugs.php.net/bug.php?id=65536&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65536&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65536&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65536&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65536&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65536&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65536&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65536&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65536&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65536&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65536&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65536&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65536&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65536&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65536&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65536&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65536&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65536&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65536&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65536&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65536&r=mysqlcfg