Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 2010 16:07:23 +0100
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        freebsd-ports@freebsd.org
Cc:        ale@FreeBSD.org
Subject:   Re: php5-gd PNG support broken
Message-ID:  <4B8540AB.9040807@bsdforen.de>
In-Reply-To: <4ADFFB1D.2070003@bsdforen.de>
References:  <4ADFFB1D.2070003@bsdforen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22/10/2009 08:26, Dominic Fandrey wrote:
> I've got the following problem with php5-gd:
> 
> Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: [00][00][00][00]: unknown critical chunk in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385
> 
> Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385
> 
> Warning: imagecreatefrompng() [function.imagecreatefrompng]: './templates/neo/layout/header_stretch.png' is not a valid PNG file in /usr/home/kamikaze/devel/workspace/realmsofsorrow/nightmare/core/nmTemplate.class.php on line 385
> 
> 
> I get this message for all PNGs. I checked the files with Firefox,
> and Gimp, they are all whole. They are also displayed by the e17
> file browser, which relies on libpng.

The problem still persists!


> My system:
> FreeBSD mobileKamikaze.norad 7.2-STABLE FreeBSD 7.2-STABLE #0: Fri Jul  3 10:26:33 CEST 2009     root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b  amd64

My system, now:
FreeBSD mobileKamikaze.norad 8.0-STABLE FreeBSD 8.0-STABLE #1: Tue Feb 23 10:37:52 CET 2010     root@mobileKamikaze.norad:/usr/obj/HP6510b-8/amd64/usr/src/sys/HP6510b-8  amd64

> libpng:
> png-1.2.40

libpng, now:
png-1.2.42

> php5-gd:
> php5-gd-5.2.11_1

php5-gd, now:
php5-gd-5.2.12


I have found a workaround:
# env LD_PRELOAD=/usr/local/lib/libpng.so.5 /usr/local/etc/rc.d/apache22 restart

I find the implications deeply troubling. Note that ldd has no problems
locating the library:
# ldd /usr/local/lib/php/20060613/gd.so
/usr/local/lib/php/20060613/gd.so:
...
	libpng.so.5 => /usr/local/lib/libpng.so.5 (0x80120d000)
...


So why does the apache module fail to load it? Why do I have to force
the runtime linker to do so?

-- 
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B8540AB.9040807>