Edit report at https://bugs.php.net/bug.php?id=65536&edit=1
ID: 65536 Updated by: requi...@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