Not a PNG 2048 pixel error
by John Kostrzewski · in Torque Game Builder · 03/02/2011 (5:15 pm) · 8 replies
I'm creating a 2d game with images in illustrator, then I'm exporting them as a png file. I'm having troubles when exporting an animated sprite sheet.
When I create and export a tree, for example, everything is fine. When I create and export a single image of my character, everything's fine. When I try to create and export a sheet for animation, I get the, "Error, cannot load pngs taller than 2048 pixels!" message, then Torque crashes.
Here's the deal: the image isn't taller than 2048 pixels (I've tried shrinking it down to everything including 100px and it still won't work), it's comprised of the same file that the character image is, the file size is smaller than the other files, and if I export as another file type (jpeg, for example) it imports fine (but has a white background).
Does anybody know what is going on here?
When I create and export a tree, for example, everything is fine. When I create and export a single image of my character, everything's fine. When I try to create and export a sheet for animation, I get the, "Error, cannot load pngs taller than 2048 pixels!" message, then Torque crashes.
Here's the deal: the image isn't taller than 2048 pixels (I've tried shrinking it down to everything including 100px and it still won't work), it's comprised of the same file that the character image is, the file size is smaller than the other files, and if I export as another file type (jpeg, for example) it imports fine (but has a white background).
Does anybody know what is going on here?
#2
03/03/2011 (8:31 am)
It won't even load the file. It comes up with the error and crashes.
#3
03/03/2011 (8:42 am)
Out of interest, have you tried a png exported from something other than illustrator? It's possible that the header (for whatever reason) is incorrect. I don't have a copy of illustrator to check it though.
#4
http://optipng.sourceforge.net/
03/03/2011 (9:36 am)
Yes, if your program is storing non-standard information in your PNG header, you should run it through optiPNG.http://optipng.sourceforge.net/
#5
@Gavin: I tried exporting it out of Photoshop, but still no import.
I did find a solution; or, at least, a temporary one. I created a new illustrator character sheet with a simple circle on it to see if maybe the file was corrupted. The sheet imported fine. Then I tried copying the character image to a new file and made a character sheet but it wouldn't import. Here's the kicker: I renamed it from blob2.png to blobtwo.png and it imported. This would lead me to believe that it has something to do with numbers in the filename, but the simple circle character sheet I first created I left as untitled-1.png and that imported.
I don't know what the issue is/was, but I found a temporary workaround for it. I hope I don't run into it again.
03/03/2011 (11:23 am)
@David: I didn't try the Optipng program because I have a Mac and that looks to be Windows only?@Gavin: I tried exporting it out of Photoshop, but still no import.
I did find a solution; or, at least, a temporary one. I created a new illustrator character sheet with a simple circle on it to see if maybe the file was corrupted. The sheet imported fine. Then I tried copying the character image to a new file and made a character sheet but it wouldn't import. Here's the kicker: I renamed it from blob2.png to blobtwo.png and it imported. This would lead me to believe that it has something to do with numbers in the filename, but the simple circle character sheet I first created I left as untitled-1.png and that imported.
I don't know what the issue is/was, but I found a temporary workaround for it. I hope I don't run into it again.
#6
If you don't want to compile optiPNG for OS X, then use Squeezer:
http://cloud33.com/squeezer/
03/03/2011 (11:32 am)
That's strange.If you don't want to compile optiPNG for OS X, then use Squeezer:
http://cloud33.com/squeezer/
#7
But another important thing to check is the DPI. Some programs will work off your screen's presumed DPI (which is usually correct these days), calculate the difference from that to the DPI selected for the image, then totally destroy your image by multiplying the resolution stored by the factor difference. DPI is pointless if you're not doing print, and some programs have the completely wrong idea about it.
Preview should show the relevant info stored with cmd-i.
03/04/2011 (2:12 am)
Or simply save it out from Preview, or use pngout.But another important thing to check is the DPI. Some programs will work off your screen's presumed DPI (which is usually correct these days), calculate the difference from that to the DPI selected for the image, then totally destroy your image by multiplying the resolution stored by the factor difference. DPI is pointless if you're not doing print, and some programs have the completely wrong idea about it.
Preview should show the relevant info stored with cmd-i.
#8
Will it load into the game directly, through script?
03/04/2011 (6:18 am)
Can you post the datablock used to set up your image and animation?Will it load into the game directly, through script?
Associate David Montgomery-Blake
David MontgomeryBlake
Did you re-load the file or is it using the original cached copy in the project directory? Check the console and it should tell you exactly where it loads the asset.