php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: upstaked at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-09-01 22:58 UTC] 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
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-01 23:40 UTC] sniper@php.net
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: Thu Dec 26 15:01:32 2024 UTC