php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50734 GD won't complie against libpng 1.4.0
Submitted: 2010-01-12 22:31 UTC Modified: 2010-01-12 22:47 UTC
From: tsteiner at nerdclub dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tsteiner at nerdclub dot net
New email:
PHP Version: OS:

 

 [2010-01-12 22:31 UTC] tsteiner at nerdclub dot net
Description:
------------
From the libpng README at ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.0-README.txt :
"Removed the deprecated png_check_sig() function/macro."

The file ext/gd/libgd/gd_png.c currently uses this function and so will not compile against libpng 1.4.0.  The libpng man page notes the following:

"The function
    png_check_sig(sig, num) was replaced with
    !png_sig_cmp(sig, 0, num) It has been deprecated since libpng-0.90."

I made the following change in gd_png.c and php compiled successfully.


--- ext/gd/libgd/gd_png.c.bad     2010-01-12 16:16:18.000000000 -0600
+++ ext/gd/libgd/gd_png.c 2010-01-12 16:16:55.000000000 -0600
@@ -145,7 +145,7 @@
                return NULL;
        }
 
-       if (!png_check_sig (sig, 8)) { /* bad signature */
+       if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
                return NULL;
        }
 


Reproduce code:
---------------
Compile PHP with --with-gd and --with-libpng-dir pointing to a libpng-1.4.0 install.

Expected result:
----------------
PHP should compile without error.

Actual result:
--------------
ext/gd/libgd/.libs/gd_png.o: In function `php_gd_gdImageCreateFromPngCtx':
....../php-5.3.1/ext/gd/libgd/gd_png.c:148: undefined reference to `png_check_sig'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-12 22:47 UTC] pajoye@php.net
Already fixed in SVN.

Thanks for your report!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 25 04:01:30 2024 UTC