image sizes

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

image sizes

Post by the underminer »

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
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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.
Altair
Posts: 76
Joined: Sat May 20, 2006 2:33 am
Location: The Netherlands

Post by Altair »

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?
be2003
Posts: 144
Joined: Thu Apr 20, 2006 2:46 pm

Post by be2003 »

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
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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: Select all

	if (width > 512 || height > 512) {
		free(image);
		fclose(fp);
		png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
		return NULL;
	}
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

I used this really old windows version by lumo. I'll try some newer versions
Behold! The Underminer got hold of a PSP
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

Yes!, it works with the 0.14 windows version I found on luaplayer.org
Behold! The Underminer got hold of a PSP
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

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.
Altair
Posts: 76
Joined: Sat May 20, 2006 2:33 am
Location: The Netherlands

Post by Altair »

Nope it works perfectly, no troubles with it what so ever!
Post Reply