Page 1 of 1

png Problems

Posted: Mon Jan 11, 2010 7:36 am
by paines
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

Posted: Mon Jan 11, 2010 8:19 am
by ragnarok2040
It seems to be working fine for me, here's my output:

Code: Select all

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.

Posted: Mon Jan 11, 2010 9:09 am
by paines
After checking out and recompiling now pngloading /displaying works great. Thanks for the hint mate.

BR
paines