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 

png Problems

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
paines



Joined: 18 Mar 2008
Posts: 6

PostPosted: Mon Jan 11, 2010 7:36 am    Post subject: png Problems Reply with quote

Hi

I have problems loading and displaying png Files. I am porting a game which uses PNG for all gfx. I can see on console from pksh that everytime a png is loaded the file descriptor stays the same(it's 2 or 3). I changed the code to load tga's and converted all png's to tga files, and everything works fine. libpng comes with a pngtest programm which also failes. The generated PNG looks the same but is shorter for ~20 Bytes.
I saw that png uses zlib and thought maybe thats the problem. But zlib comes also with a test programm which works fine.

Any clue what the problem with png could be ?

BR
paines
Back to top
View user's profile Send private message Visit poster's website
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Mon Jan 11, 2010 8:19 am    Post subject: Reply with quote

It seems to be working fine for me, here's my output:
Code:

loadelf: fname host:pngtest.elf secname all

loadelf version 3.30

Input ELF format filename = host:pngtest.elf

0 00100000 000365ac ....

Loaded, host:pngtest.elf

start address 0x1000e0

gp address 00000000

Testing libpng version 1.2.33
   with zlib   version 1.2.3

 libpng version 1.2.33 - October 31, 2008
   Copyright (c) 1998-2008 Glenn Randers-Pehrson
   Copyright (c) 1996-1997 Andreas Dilger
   Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

 library (10233): libpng version 1.2.33 - October 31, 2008

 pngtest (10233): libpng version 1.2.33 - October 31, 2008
 sizeof(png_struct)=976, sizeof(png_info)=400
Testing host:pngtest.png:open name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 602 data 44978

open fd = 3

open name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 1 data 44978

open fd = 3


Files host:pngtest.png and host:pngout.png are different
   Was host:pngtest.png written with the same maximum IDAT chunk size (8192 bytes),
   filtering heuristic (libpng default), compression level (zlib default),
   and zlib version (1.2.3)?

open name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 602 data 44978

open fd = 3


 Pass 0: rwrwrwrwrwrwrwrwrw
 Pass 1: rwrwrwrwrwrwrwrwrw
 Pass 2: rwrwrwrwrwrwrwrw
 Pass 3: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
 Pass 4: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
 Pass 5: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
         rwrwrwrw
 Pass 6: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
         rwrwrwrwrwopen name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 1 data 44978

open fd = 3


Files host:pngtest.png and host:pngout.png are different
open name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 602 data 44978

open fd = 3

open name host:pngtest.png flag 1 data 44978

open fd = 2

open name host:pngout.png flag 1 data 44978

open fd = 3


Files host:pngtest.png and host:pngout.png are different

 PASS (9782 zero samples)
 Filter 0 was used 21 times
 Filter 1 was used 15 times
 Filter 2 was used 52 times
 Filter 3 was used 10 times
 Filter 4 was used 33 times
 tIME = 7 Jun 1996 17:58:08 +0000
libpng passes test

I made a new port of libpng-1.2.33 and zlib-1.2.3 a while ago, and there were some problems upgrading the older versions in svn, but that was solved a few months ago. I did have problems with the previous version of libpng, though. I had to use the libpng binary from the myPS2 project in order to get viewable image data.
Back to top
View user's profile Send private message
paines



Joined: 18 Mar 2008
Posts: 6

PostPosted: Mon Jan 11, 2010 9:09 am    Post subject: Reply with quote

After checking out and recompiling now pngloading /displaying works great. Thanks for the hint mate.

BR
paines
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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