Bug #65536 [Opn->Nab]: getimagesize() returning wrong value for IMG_PNG

From: Date: Sat, 24 Aug 2013 00:58:08 +0000
Subject: Bug #65536 [Opn->Nab]: getimagesize() returning wrong value for IMG_PNG
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181152@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65536&edit=1 ID: 65536 Updated by: requinix@php.net Reported by: hammadullahkhan at gmail dot com Summary: getimagesize() returning wrong value for IMG_PNG -Status: Open +Status: Not a bug Type: Bug Package: PHP options/info functions Operating System: windows PHP Version: 5.4.19 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php [2] is an IMAGETYPE constant, not an IMG constant. Previous Comments: ------------------------------------------------------------------------ [2013-08-23 23:23:28] hammadullahkhan at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=65536&edit=1

« previous php.bugs (#181152) next »