forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

image sizes

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
the underminer



Joined: 03 Oct 2005
Posts: 124
Location: Netherlands

PostPosted: Fri May 19, 2006 4:13 am    Post subject: image sizes Reply with quote

I want some clarity here, people. In theory, luaplayer should be able to handle 512x512 images. I found out earlier that 512 width is not supported, but it now seems that the height can't be greater than 272 either.
I tried the windows version of luaplayer and it gave me an invalid image size error with this code: Image.createEmpty(64, 320). Can anyone tell me if this also occurs on the psp? And what are the actual restrictions? I'm not sure what resolutions are supported
_________________
Behold! The Underminer got hold of a PSP
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri May 19, 2006 6:00 am    Post subject: Reply with quote

In the PSP LuaPlayer, it won't allow you to load an image over 512x512 pixels (the loadImage function in graphics.c checks and returns null if it didn't load, the Lua function then spits out an error on a debug screen).
I don't think I've ever tried an image bigger then 272 on LuaPlayer though...

Hmm... it would be interesting to make a LuaPlayer that uses OSLib as it's image functions. It should speed up many many programs and would support images bigger then 512x512.
Back to top
View user's profile Send private message
Altair



Joined: 20 May 2006
Posts: 76
Location: The Netherlands

PostPosted: Sat May 20, 2006 7:31 am    Post subject: Reply with quote

How come nobody knows this and i keep telling everybody?

Lua can handle bigger images than 512x512. I myself use 1000x1000 images. There is one catch it has to be in JPG format. Also it shouldn't be to big a filesize (ok so two catches). The biggest i use is 58 kB. I haven't tested the limits, but maybe Shine can tell us?
Back to top
View user's profile Send private message
be2003



Joined: 20 Apr 2006
Posts: 144

PostPosted: Sat May 20, 2006 8:47 am    Post subject: Reply with quote

512x512 is the max for Image.createEmpty not Image.load and if your version is up to date it should be no issue...
_________________
- be2003
blog
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Sat May 20, 2006 8:55 am    Post subject: Reply with quote

Image.load calls the C function loadImage, does it not? That then checks to see if the image is a PNG. If it is, it calls loadPngImage.
This code is right in graphics.cpp...
Code:
   if (width > 512 || height > 512) {
      free(image);
      fclose(fp);
      png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
      return NULL;
   }
Back to top
View user's profile Send private message
the underminer



Joined: 03 Oct 2005
Posts: 124
Location: Netherlands

PostPosted: Sat May 20, 2006 4:47 pm    Post subject: Reply with quote

I used this really old windows version by lumo. I'll try some newer versions
_________________
Behold! The Underminer got hold of a PSP
Back to top
View user's profile Send private message
the underminer



Joined: 03 Oct 2005
Posts: 124
Location: Netherlands

PostPosted: Sat May 20, 2006 4:57 pm    Post subject: Reply with quote

Yes!, it works with the 0.14 windows version I found on luaplayer.org
_________________
Behold! The Underminer got hold of a PSP
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon May 22, 2006 8:16 pm    Post subject: Reply with quote

Altair wrote:
Lua can handle bigger images than 512x512. I myself use 1000x1000 images. There is one catch it has to be in JPG format. Also it shouldn't be to big a filesize (ok so two catches). The biggest i use is 58 kB. I haven't tested the limits, but maybe Shine can tell us?


Maybe this is possible, but then it is a bug, because it would lead to undefined results when trying to blit it. But it's already on my TODO list to hide all this hardware related stuff and allow images as big as you have memory.
Back to top
View user's profile Send private message
Altair



Joined: 20 May 2006
Posts: 76
Location: The Netherlands

PostPosted: Tue May 23, 2006 6:23 am    Post subject: Reply with quote

Nope it works perfectly, no troubles with it what so ever!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group