Error loading images
Moderators: Shine, Insert_witty_name
Error loading images
I´m trying to slide two images, one from left to right and the other one from right to left. When both images dissapear from screen I load another two images.
The problem is when I´ve loaded 5 or 6 images, lua shows the "load error image". I tryed to change the image, the path, also checked the correct filename and path.
The program works fine in the lua player windows version. What´s wrong?
x1=-150
x2=480
cont=0
animacionxx=Image.load("imagen/foto00.jpg") --Left to right
animacionyy=Image.load("imagen/foto01.jpg") --Right to left
while true do
screen:blit(x1, 100, animacionxx)
screen:blit(x2, 25, animacionyy)
x1=x1 + 1
if x1 == 480 then
x1=-150
cont=cont+1
if cont == 1 then
animacionxx=Image.load("imagen/foto02.jpg")
elseif cont== 2 then
animacionxx=Image.load("imagen/foto04.jpg")
elseif cont== 3 then
animacionxx=Image.load("imagen/foto06.jpg")
elseif cont== 4 then
animacionxx=Image.load("imagen/foto08.jpg")
elseif cont== 5 then
animacionxx=Image.load("imagen/foto10.jpg")
elseif cont== 6 then
animacionxx=Image.load("imagen/foto12.jpg")
elseif cont== 7 then
animacionxx=Image.load("imagen/foto00.jpg")
end
end
x2=x2 - 1
if x2 == -150 then
x2=480
if cont == 1 then
animacionyy=Image.load("imagen/foto03.jpg")
elseif cont== 2 then
animacionyy=Image.load("imagen/foto05.jpg")
elseif cont== 3 then
animacionyy=Image.load("imagen/foto07.jpg")
elseif cont== 4 then
animacionyy=Image.load("imagen/foto07.jpg")
elseif cont== 5 then
animacionyy=Image.load("imagen/foto11.jpg")
elseif cont== 6 then
animacionyy=Image.load("imagen/foto13.jpg")
elseif cont== 7 then
cont=0
animacionyy=Image.load("imagen/foto01.jpg")
end
end
The problem is when I´ve loaded 5 or 6 images, lua shows the "load error image". I tryed to change the image, the path, also checked the correct filename and path.
The program works fine in the lua player windows version. What´s wrong?
x1=-150
x2=480
cont=0
animacionxx=Image.load("imagen/foto00.jpg") --Left to right
animacionyy=Image.load("imagen/foto01.jpg") --Right to left
while true do
screen:blit(x1, 100, animacionxx)
screen:blit(x2, 25, animacionyy)
x1=x1 + 1
if x1 == 480 then
x1=-150
cont=cont+1
if cont == 1 then
animacionxx=Image.load("imagen/foto02.jpg")
elseif cont== 2 then
animacionxx=Image.load("imagen/foto04.jpg")
elseif cont== 3 then
animacionxx=Image.load("imagen/foto06.jpg")
elseif cont== 4 then
animacionxx=Image.load("imagen/foto08.jpg")
elseif cont== 5 then
animacionxx=Image.load("imagen/foto10.jpg")
elseif cont== 6 then
animacionxx=Image.load("imagen/foto12.jpg")
elseif cont== 7 then
animacionxx=Image.load("imagen/foto00.jpg")
end
end
x2=x2 - 1
if x2 == -150 then
x2=480
if cont == 1 then
animacionyy=Image.load("imagen/foto03.jpg")
elseif cont== 2 then
animacionyy=Image.load("imagen/foto05.jpg")
elseif cont== 3 then
animacionyy=Image.load("imagen/foto07.jpg")
elseif cont== 4 then
animacionyy=Image.load("imagen/foto07.jpg")
elseif cont== 5 then
animacionyy=Image.load("imagen/foto11.jpg")
elseif cont== 6 then
animacionyy=Image.load("imagen/foto13.jpg")
elseif cont== 7 then
cont=0
animacionyy=Image.load("imagen/foto01.jpg")
end
end
-
- Posts: 53
- Joined: Wed Aug 31, 2005 1:43 am
-
- Posts: 171
- Joined: Mon Nov 14, 2005 1:32 am
- Location: Boston, Massachusetts
- Contact:
The two photo7s is an error mine, I tried to put others images, so the photo09.jpg is not the problem. I supose is something wrong with the memory although as far I know lua automatic free the memory.
I tried to load diferents images (jpg,png), I tried to load less images too but when it will be load the fifth o the sixth image, the programa crashes....a possible bug of luaplayer? I don´t know, I saw other scripts programs, like millionare, and they loads a lot of images.
Any help to load images with other programming method?
Thanks!!!!
I tried to load diferents images (jpg,png), I tried to load less images too but when it will be load the fifth o the sixth image, the programa crashes....a possible bug of luaplayer? I don´t know, I saw other scripts programs, like millionare, and they loads a lot of images.
Any help to load images with other programming method?
Thanks!!!!
I don´ have the problem with one image, the problem is when I tried to load the fifth/sixth image, whatever the image will be.
For example, if the image photo02.jpg I load in fifth position, the program crashes. I change to load this same image the first position and it´s works perfect.
All the images I try to load are little jpg (between 10kb and 50 kb), so the size of the image is not the problem.
The program works fine in the lua player windows version, for that reason, I guess if maybe there is a little bug in the psp version.
For example, if the image photo02.jpg I load in fifth position, the program crashes. I change to load this same image the first position and it´s works perfect.
All the images I try to load are little jpg (between 10kb and 50 kb), so the size of the image is not the problem.
The program works fine in the lua player windows version, for that reason, I guess if maybe there is a little bug in the psp version.
I changed to PNG and the problem persists. I changed a little bit the code, so I create a table to load images:
local animacion1 = {a1=Image.load("imagen/foto00.jpg"),a2=Image.load("imagen/foto02.jpg"),a3=Image.load("imagen/foto04.jpg")}
local animacion2 = {b1=Image.load("imagen/foto01.jpg"),b2=Image.load("imagen/foto03.jpg"),b3=Image.load("imagen/foto05.jpg")}
This table WORKS because it only has 3 images per table. If I try to insert 4 images in every table the program crashes (error:unable to load images).The other new images are good files because if I put them alone in the table, they work.
local animacion1 = {a1=Image.load("imagen/foto00.jpg"),a2=Image.load("imagen/foto02.jpg"),a3=Image.load("imagen/foto04.jpg")}
local animacion2 = {b1=Image.load("imagen/foto01.jpg"),b2=Image.load("imagen/foto03.jpg"),b3=Image.load("imagen/foto05.jpg")}
This table WORKS because it only has 3 images per table. If I try to insert 4 images in every table the program crashes (error:unable to load images).The other new images are good files because if I put them alone in the table, they work.