| View previous topic :: View next topic |
| Author |
Message |
ivanguerr
Joined: 16 Dec 2005 Posts: 5
|
Posted: Fri Dec 16, 2005 5:00 am Post subject: 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 |
|
| Back to top |
|
 |
2Xtremes2004
Joined: 31 Aug 2005 Posts: 53
|
Posted: Fri Dec 16, 2005 5:02 am Post subject: |
|
|
Sounds like its using all the memory, in windows you have much more memory. _________________ I want my money back!? |
|
| Back to top |
|
 |
Dr. Vegetable
Joined: 14 Nov 2005 Posts: 171 Location: Boston, Massachusetts
|
Posted: Fri Dec 16, 2005 6:30 am Post subject: |
|
|
The only strange thing I see is that you load "foto07.jpg" twice. It looks like you never load "foto09.jpg". Maybe there is a problem in Lua loading the same image on top of itself?
I am too lazy to try it myself, though... |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Fri Dec 16, 2005 7:46 am Post subject: |
|
|
ACTUALLY... your code is fine.
You have a jpg in there that luaplayer cant read.
open the jpg, edit it with MSPaint, and save it. Just put a black dot in the top left or something, but you have to change the image then save.
try that. |
|
| Back to top |
|
 |
ivanguerr
Joined: 16 Dec 2005 Posts: 5
|
Posted: Fri Dec 16, 2005 8:01 am Post subject: |
|
|
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!!!! |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Fri Dec 16, 2005 8:08 am Post subject: |
|
|
| make a test program that loads just the image that you are having trouble with. it shouldnt be a bug with luaplayer.. that wouldnt make sense because its an image. |
|
| Back to top |
|
 |
ivanguerr
Joined: 16 Dec 2005 Posts: 5
|
Posted: Fri Dec 16, 2005 8:40 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Sun Dec 18, 2005 9:56 am Post subject: |
|
|
Interesting...
Try PNG. |
|
| Back to top |
|
 |
ivanguerr
Joined: 16 Dec 2005 Posts: 5
|
Posted: Mon Dec 19, 2005 9:03 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|