From: upstaked at yahoo dot com Operating system: *nix PHP version: 5.0.4 PHP Bug Type: GetImageSize related Bug description: wrong if in ext/standard/image.c
Description: ------------ getimagesize() returns false for compressed swf files, and issues a notice. This is due to the lines in ext/standard/image.c: #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) result = php_handle_swc(stream TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version o f the zlib extension enabled."); #endif The "!defined(COMPILE_DL_ZLIB)" part of the if does not work; besides, it shouldn't even be there. So, when trying to do getimagesize() on a compressed swf: 1. Even when zlib is statically compiled, !defined(COMPILE_DL_ZLIB) fails, so you get the pretty notice no matter what. 2. Removing that part of the if, it works even when compiled --with-zlib=shared. Using zlib-1.2.1.2, zlib-devel-1.2.1.2. The same issue with the latest snapshot of php. Reproduce code: --------------- <?php error_reporting( E_ALL | E_STRICT); print_r( getimagesize('compressed.swf') ); print_r( getimagesize('not_compressed.swf') ); ?> Expected result: ---------------- Array ( [0] => 550 [1] => 400 [2] => 13 [3] => width="550" height="400" [mime] => application/x-shockwave-flash ) Array ( [0] => 550 [1] => 400 [2] => 4 [3] => width="550" height="400" [mime] => application/x-shockwave-flash ) Actual result: -------------- Notice: getimagesize(): The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled. in /_index.php on line 14 Array ( [0] => 550 [1] => 400 [2] => 4 [3] => width="550" height="400" [mime] => application/x-shockwave-flash ) -- Edit bug report at http://bugs.php.net/?id=34338&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34338&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34338&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34338&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34338&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34338&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34338&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34338&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34338&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34338&r=support Expected behavior: http://bugs.php.net/fix.php?id=34338&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34338&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34338&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34338&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34338&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34338&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34338&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34338&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34338&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34338&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34338&r=mysqlcfg