|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34338 wrong if in ext/standard/image.c
Submitted: 2005-09-01 22:58 UTC Modified: 2005-09-09 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: upstaked at yahoo dot com Assigned:
Status: No Feedback Package: GetImageSize related
PHP Version: 5.0.4 OS: *nix
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: upstaked at yahoo dot com
New email:
PHP Version: OS:


 [2005-09-01 22:58 UTC] upstaked at yahoo dot com
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);
                        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.");


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-, zlib-devel-
The same issue with the latest snapshot of php.

Reproduce code:
error_reporting( E_ALL | E_STRICT);




Expected result:
    [0] => 550
    [1] => 400
    [2] => 13
    [3] => width="550" height="400"
    [mime] => application/x-shockwave-flash
    [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
    [0] => 550
    [1] => 400
    [2] => 4
    [3] => width="550" height="400"
    [mime] => application/x-shockwave-flash


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-01 23:40 UTC]
Works fine for me. Provide an example of file with which this does not work.

 [2005-09-09 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 07:01:28 2024 UTC