Page 1 of 1

Can't open png file on Linux/Slackware

Posted: Mon Aug 18, 2014 8:55 am
by Pilo
Hello everyone!

I build lua Love 0.9.1 on slackware (64bits), but for an unknown reason I can't open png file, I get this error message :
Error: Could not decode image!
stack traceback:
[C]: at 0x7f22152a68f0
[C]: in function 'newImage'
main.lua:130: in function 'setupTileset'
main.lua:161: in function 'load'
[string "boot.lua"]:407: in function <[string "boot.lua"]:399>
[C]: in function 'xpcall'

love is linked with libpng, devIL is compiled with png support, and I can load other image format (tga for example) without problem.

Is there a way to build love in debug mode so I can step into the code to see what's going on?

Thank you!

regards,
Pilo

Re: Can't open png file on Linux/Slackware

Posted: Mon Aug 18, 2014 9:31 am
by bartbes
Are you sure it's not a specific png image that's failing?

Re: Can't open png file on Linux/Slackware

Posted: Mon Aug 18, 2014 9:53 am
by Pilo
I try many images, including some I use in another opengl project.
Also, I start working with love with windows, and everything works as expected. But if I try to run the project in Linux, I get this error message.

Re: Can't open png file on Linux/Slackware

Posted: Mon Aug 25, 2014 8:55 am
by Pilo
Just an update on this : it has nothing to do with Love, it's a problem with devIL, which can't load png on my linux... (it report an error with libpng).

Re: Can't open png file on Linux/Slackware

Posted: Mon Aug 25, 2014 5:33 pm
by bartbes
Maybe you can try recompiling devil, then?

Re: Can't open png file on Linux/Slackware

Posted: Wed Aug 27, 2014 8:42 am
by Pilo
Yes that's what I did!
It works now!

I messed up when build DevIL the first time (I didn't put it inside /usr/lib64), and I end up with 2 DevIL compiled with 2 different versions of libpng (libpng12 and libpng14).

Re: Can't open png file on Linux/Slackware

Posted: Wed Sep 17, 2014 8:48 pm
by winded
Can you provide some more information? I've got the exact same error message. I'm running openSUSE. I've tired reinstalling devIL a few times now and it's not making any difference. The links to libIL, libILU, and libILUT are showing up in /usr/local/lib64, so I'm pretty sure that's working correctly. I don't get any error messages throughout the autoreconf, configure, make, install, and ldconfig steps. The only thing weird is that when I do "sudo ldconfig" I don't have any output. Should I?

Anyway any help you could provide would be great. Thanks a ton - I'm brand new to Love and would be able to actually see graphics!

Re: Can't open png file on Linux/Slackware

Posted: Mon Sep 22, 2014 2:04 pm
by winded
I still haven't figured this out, but I think it must be something I'm doing wrong. I installed Fedora 20, and LOVE is prebuilt in Fedora. It's version 0.9.0, and I installed it directly out of the repositories. After updating everything, I have the same issue. Hello World (tutorial 0) works, Hamster Ball does not. I got the same error message:

Code: Select all

$ love HamsterBall/
Error: Could not decode image!
stack traceback:
	[C]: at 0x7f68c8873710
	[C]: in function 'newImage'
	main.lua:4: in function 'load'
	[string "boot.lua"]:394: in function <[string "boot.lua"]:387>
	[C]: in function 'xpcall'
I noticed that DevIL-devel wasn't installed, so I got that off the repos as well. Same message.
Given that this is a different Linux distro, a fresh install of LOVE, and I didn't build anything from source (all precompiled) I really can't figure out what to do next. Are the any Linux/LOVE geniuses that can help me out?

Re: Can't open png file on Linux/Slackware

Posted: Wed Sep 24, 2014 4:11 pm
by winded
OK, I feel very foolish. I finally worked out that DevIL doesn't work with libpng16 OR libpng14, and I needed to download and install libpng12, then recompile DevIL. Now it finally works! I can see some stuff online about patches to DevIL to make it work with newer versions of libpng, but for now I think I'm going to just leave it. If anyone has any good instructions for how to patch DevIL to work for libpng16, it may be worth it to put them on the building Love page? At least a new version of DevIL is released that's compatible?