ID:               34338
 Updated by:       [EMAIL PROTECTED]
 Reported By:      upstaked at yahoo dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         GetImageSize related
 Operating System: *nix
 PHP Version:      5.0.4
 New Comment:

Works fine for me. Provide an example of file with which this does not
work.



Previous Comments:
------------------------------------------------------------------------

[2005-09-01 22:58:45] upstaked at yahoo dot com

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 this bug report at http://bugs.php.net/?id=34338&edit=1

Reply via email to