Texture error on Mac Os X

Ok, here we are…
I’ve successfully managed to compile under Leopard the Panda 3d source.
In a python console type import.directbase.DirectStart and next run() gives me a window with a gray backgroun, and pview gives me the same windows with a small (and strange colored) triangle in the middle, so I think it’s all right with the libraries.

But when I try to run the Asteroids demo here’s what I get:

DirectStart: Starting the game.
:interrogatedb(warning): Classes Http_Request and Socket_TCP share the same TypeHandle value (42); check class definitions.
Warning: DirectNotify: category 'Interval' already exists
:display: loading display module: libpandagl.dylib
Known pipe types:
(all display modules loaded.)
:08-19-2008 22:01:35 ShowBase(info): Default graphics pipe is OpenGL (osxGraphicsPipe).
:display:osxdisplay: Creating standard window
:display:osxdisplay: In Resize.....size=(800, 600) title="Panda" !undecorated !fullscreen foreground !minimized open !cursor_hidden absolute 
:display:osxdisplay: Resize Complete.....
:display:osxdisplay: Event handler installed, now buildGL
:display:osxdisplay: BuildGL complete, set properties
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager
:util(warning): Adjusting global clock's real time by 0.207258 seconds.
:08-19-2008 22:01:35 ShowBase(info): __dev__ == 0
:pnmtext: Loaded font Nimbus Sans L Regular Condensed
:loader: loading file type module: ptloader
:egg2pg: Reading ./models/plane.egg.pz
:egg2pg: Flattened 1 nodes.
:gobj: Loading texture /Users/eliaballade/src/panda3d-1.5.2/samples/Asteroids/textures/stars.png
:gobj: Loading texture /Users/eliaballade/src/panda3d-1.5.2/samples/Asteroids/textures/ship.png
:pnmimage:png(warning): cHRM: CRC error
:pnmimage:png(error): x[DA]b[F8]: invalid chunk type
:gobj(error): Texture::read() - couldn't read: /Users/eliaballade/src/panda3d-1.5.2/samples/Asteroids/textures/ship.png
:gobj(error): Texture "/Users/eliaballade/src/panda3d-1.5.2/samples/Asteroids/textures/ship.png" exists but cannot be read.
Traceback (most recent call last):
  File "Tut-Asteroids.py", line 382, in <module>
    w = World()
  File "Tut-Asteroids.py", line 93, in __init__
    self.ship = loadObject("ship")             #Load the ship
  File "Tut-Asteroids.py", line 66, in loadObject
    obj.setTexture(tex, 1)                           #Set the texture
TypeError: Arguments must match one of:
setTexture(non-const NodePath this, non-const Texture tex)
setTexture(non-const NodePath this, non-const TextureStage stage, non-const Texture tex)
setTexture(non-const NodePath this, non-const Texture tex, int priority)
setTexture(non-const NodePath this, non-const TextureStage stage, non-const Texture tex, int priority)

:display: Closing osxGraphicsWindow

I don’t think this is so good…
Help, pleaseee!!!

Can you see or edit /Users/eliaballade/src/panda3d-1.5.2/samples/Asteroids/textures/ship.png from an external program, other than panda?

:pnmimage:png(error): x[DA]b[F8]: invalid chunk type 

It just looks like the png is invalid, though I wonder, did you change some settings in Config.prc? You seem to have quite some messages running around.

Yes, I can view and edit it (although I didn’t edit it for security reasons)

My Config.prc is

plugin-path /usr/local/panda/lib 
default-model-extension .egg.pz 
model-path .

exists but cannot be read… this line sorta makes me thing you that you didnt have zlib development headers installed or something simmilar so png-support was not build correctly or not at all.
can you try to convert the image into a different format? jpeg maybe? or some others?

I installed png-devel support with

sudo port install libpng

Indeed in ppremake:

Configuring support for the following optional third-party packages:
+ OpenSSL
+ libjpeg
+ libpng
+ libtiff
+ libtar
+ fftw

and no make error

I’ve tried to convert some textures in jpg… No sorta problems with that… I’ve also tried to re-save in png… Different bad chunk but still no results…

Perhaps there’s more than one conflicting libjpeg.dylib / libjpeg.so file pair on your system?