#50734 [NEW]: GD won't complie against libpng 1.4.0
| From: | tsteiner at nerdclub dot net | Date: | Tue, 12 Jan 2010 22:31:19 +0000 |
| Subject: | #50734 [NEW]: GD won't complie against libpng 1.4.0 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-146593@lists.php.net to get a copy of this message | ||
From: tsteiner at nerdclub dot net
Operating system: Linux
PHP version: 5.3.1
PHP Bug Type: Compile Failure
Bug description: GD won't complie against libpng 1.4.0
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
--
Edit bug report at http://bugs.php.net/?id=50734&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50734&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50734&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50734&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50734&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50734&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50734&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50734&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50734&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50734&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50734&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50734&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50734&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50734&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50734&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50734&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50734&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50734&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50734&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50734&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50734&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50734&r=mysqlcfg