Does Irrlicht still use it's own libpng on Linux (saw a comment in the changelog for 1.5 that it doesn't on Mac OS X)? I'm still dying to see my problem being fixed, either from the package maintainer in Gentoo, or in Irrlicht. But somehow nobody else seems to have the same problem I do.
It's more than one year later now, and I still see the same problem on my computer (both Gentoo (desktop) and Ubuntu (laptop).
PNG FATAL ERROR: Invalid image width
It's an irrlicht bug.
Curiously, there are three calls to png_get_IHDR in that file, of which
one does it correctly and these two don't.
Code: Select all
--- irrlicht-1.5/source/Irrlicht/CImageLoaderPNG.cpp~ 2008-12-14 07:15:56.000000000 -0500
+++ irrlicht-1.5/source/Irrlicht/CImageLoaderPNG.cpp 2009-01-09 16:56:30.000000000 -0500
@@ -184,9 +184,14 @@
// Update the changes
png_read_update_info(png_ptr, info_ptr);
- png_get_IHDR(png_ptr, info_ptr,
- (png_uint_32*)&Width, (png_uint_32*)&Height,
- &BitDepth, &ColorType, NULL, NULL, NULL);
+ {
+ png_uint_32 w,h;
+ png_get_IHDR(png_ptr, info_ptr,
+ &w, &h,
+ &BitDepth, &ColorType, NULL, NULL, NULL);
+ Width=w;
+ Height=h;
+ }
// Convert RGBA to BGRA
if (ColorType==PNG_COLOR_TYPE_RGB_ALPHA)
@@ -199,9 +204,14 @@
}
// Update the changes
- png_get_IHDR(png_ptr, info_ptr,
- (png_uint_32*)&Width, (png_uint_32*)&Height,
- &BitDepth, &ColorType, NULL, NULL, NULL);
+ {
+ png_uint_32 w,h;
+ png_get_IHDR(png_ptr, info_ptr,
+ &w, &h,
+ &BitDepth, &ColorType, NULL, NULL, NULL);
+ Width=w;
+ Height=h;
+ }
// Create the image structure to be filled by png data
if (ColorType==PNG_COLOR_TYPE_RGB_ALPHA)
one does it correctly and these two don't.