PDA

View Full Version : Image.load error in Lua



Prasoc
August 7th, 2006, 23:24
Hi, I started learning lua today (:P) and when i try to set a background using Image.load(filename) it gives the error

Image.load: Error loading image
It is 480x272 exactly and is .png, what is the problem?

yaustar
August 7th, 2006, 23:45
Filename or filepath incorrect? Can you show the exact line of code that gives the error?

Prasoc
August 7th, 2006, 23:47
background = Image.load("background-night.png")

yaustar
August 7th, 2006, 23:56
How are you running the scripts? Is the image in the same folder as the script? Is the script in the same folder as the luaplayer.exe?

Prasoc
August 7th, 2006, 23:57
The script is in a folder and it is with the image. but the luaplayer is in a different folder.

yaustar
August 8th, 2006, 00:01
Can you show the batch file that you are using to run the script?

Prasoc
August 8th, 2006, 00:02
test.cmd:

luaplayer "Legend of Thuan\index.lua"

yaustar
August 8th, 2006, 00:07
If you do it that way, the pictures have to be in the same directory as the exe.

If you have following:
"../luaplayer.exe" index.lua
pause

and the .cmd file in the same directory as the script, the pictures must be in the same directory as the script.

Prasoc
August 8th, 2006, 00:08
But playing it on the psp gives out the error "libpng error: idat: crc error"?

MasterChafed
August 8th, 2006, 00:46
are u getting the Image.load error in lua for psp? If so what version of Lua Player are u using? I had similar problems when using luaplayer .20, if u are using this version, try using version .16, thats what I had to use to get past that problem in Halo 2d.

Prasoc
August 8th, 2006, 00:46
i got it to work, thanks you guys.

MasterChafed
August 8th, 2006, 03:33
glad to hear it, what was the problem?

Prasoc
August 8th, 2006, 10:06
well the png file was interlaced and i was using .20 ^_^

MasterChafed
August 8th, 2006, 10:42
lol. glad its fixed

jman420
August 9th, 2006, 07:59
only thing I can think of is that it doesent like the dash - in the filename... otherwise it seems like it should work... try it without the dash :D

yaustar
August 9th, 2006, 09:51
Hypens are fine to use in filenames.