I am trying to use LodePNG to load images in my iOS/Android NDK code, but it returns an error saying "first chunk is not the header chunk".
I am using this code (currently testing on iOS):
std::string nsw = "Test.png";
unsigned int width, height = 0;
std::vector<unsigned char> pixels;
NSString *path = [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:nsw.data()] ofType:nil];
unsigned error = lodepng::decode(pixels, width, height, std::string(path.UTF8String));
SysUtils::Log(lodepng_error_text(error));
And I've tried a few different PNG files, this is one of them: http://sharesend.com/hg3qb36s
I've set breakpoints in the file loading part of LodePNG and it starts with a "\x89" character followed by "PNG" in the loaded data, so I think that it should work.
0 comments:
Post a Comment