php5-gd PNG support broken

Dominic Fandrey kamikaze at
Wed Feb 24 15:07:25 UTC 2010

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 at 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 at mobileKamikaze.norad:/usr/obj/HP6510b-8/amd64/usr/src/sys/HP6510b-8  amd64

> libpng:
> png-1.2.40

libpng, now:

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

php5-gd, now:

I have found a workaround:
# env LD_PRELOAD=/usr/local/lib/ /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/
... => /usr/local/lib/ (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? 

More information about the freebsd-ports mailing list