I get these messages filling-up my terminal when I compile a map with q3map2 built against libpng 1.6, I'm building q3map2 on Ubuntu Yakkety that does not ship
WARNING: An error occurred reading PNG image libpng error: bad parameters to zlib
If I build q3map2 using
libpng12-dev from Ubuntu Xenial it works, badly I can't downgrade that libpng dev package without affecting other packages and that's a no-go for me. It looks like the only workaround available to me is to keep a dedicated Xenial chroot just to build q3map2.
Hmm, it's probably a build issue when both libpng12 and libpng16 are available, like building against libpng-1.6 and linking against libpng-1.2. I can build q3map2 from GtkRadiant against libpng16 without doing anything and it runs nicely.
Ubuntu Xenial (current LTS) still ships both libpng12 and libpng16, and probably many others current distros too.
Edit: I really don't understand what is happening there,
image.cfrom GtkRadiant and NetRadiant trees are the same on png part.
Easy way to reproduce the libpng bug:
git clone https://github.com/InterstellarOasis/map-rsmse_src.dpkdir.git cd map-rsmse_src.dpkdir q3map2 -fs_pakpath . -bsp -game tremulous -meta -custinfoparms maps/rsmse.map q3map2 -fs_pakpath . -vis -game tremulous -fast -saveprt maps/rsmse.bsp q3map2 -fs_pakpath . -light -game tremulous -fast -shade -dirty -patchshadows -samples 1 -samplesize 8 -bouncegrid -bounce 1 -lightmapsize 1024 -external maps/rsmse.bsp
-lightcompilation stages will spit out many lines like that:
libpng error: bad parameters to zlib WARNING: An error occurred reading PNG image
On my end, stuff looks ok:
$ objdump -x ~/dev/netradiant/build/q3map2 | grep NEEDED NEEDED libglib-2.0.so.0 NEEDED libjpeg.so.8 NEEDED libpng16.so.16 NEEDED libz.so.1 NEEDED libxml2.so.2 NEEDED libpthread.so.0 NEEDED libm.so.6 NEEDED libc.so.6 $ ldd ~/dev/netradiant/build/q3map2 | grep libpng libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f080b0f3000) $ objdump -x /usr/lib/x86_64-linux-gnu/libpng16.so.16 | grep NEEDED NEEDED libz.so.1 NEEDED libm.so.6 NEEDED libc.so.6
But it looks like there is a mismatch somewhere.
Just to add that if I copy
q3map2faces the same libpng issues, even if GtkRadiant build works well and NetRadiant build does not work. I'm not sure the bug is in the code, or it could be a mismatch with some other part of the code. I looked to
tools/quake3/common/unzip.cbecause both this code an libpng use zlib, but unless I missed something, I haven't seen something significant between both GtkRadiant and NetRadiant source tree to explains why one runs and other one does not run.