Android: No handler for bitmap extensions .png

Any idea here....

I/allegro (14621): bitmap W 14634: bitmap_io.c:243 al_load_bitmap_flags [ 0.42207] No handler for bitmap extensions .png - therefore not trying to load //sdcard//.tetris//images//loading_game_bg.png.

loading_background = al_load_bitmap(LoadingGameBackground);

Matthew Leverton

Call al_init_image_addon() prior to loading a bitmap.


Ok will try but seems to happen on example too....

I/allegro (14802): bitmap W 14816: bitmap_io.c:243 al_load_bitmap_flags [ 0.25266] No handler for bitmap extensions .png - therefore not trying to load alexlogo.png.
I/allegro (14802): main D 14816: main.c:88 main [ 0.25281] failed to load alexlogo.png

Actually I was...

LOGI("Initializing add ons...");

Let me know if checking in my version (different would help you. I just wanted my .sos locally not in my toolchain.

Trent Gamblin

You need to build libpng for Android with the ndk compiler and put it where Allegro can find it. Easiest is to put it in android-toolchain/sysroot/usr/(lib|include), but you can also pass cmake -DPNG_LIBRARY= and -DPNG_INCLUDE_DIR=. If you want to try out the native image loader on Android (which was broken but I committed a fix that may have fixed it) then let me know, I'll set it back up in git. It should "seem" to work at first, but before after loading a lot of images (during a long gameplay of a few hours) it would inevitably crash.


So when you say use libpng would I have to do anything besides including the library? Would I have to rebuild Allegro after?

With the native loader what does that mean? Loaded entirely within native? Is that how the example application is doing it?

Also would it work as is with a bmp? Yup seems fine as a bmp I will play around with it.

Trent Gamblin

For libpng you'd have to build libpng and recompile Allegro.

The native loader actually uses Java, it's called native because it's "native to Android" but doesn't require any extra libraries. You'd also have to rebuild Allegro.

BMP, PCX and TGA should all work still since they're built-in to Allegro with no extra dependencies.


Ok I finally got around to playing with the libpng side of this...

Tried this...

ccmake .. -DANDROID_NDK_TOOLCHAIN_ROOT=$TC -DWANT_ANDROID=on  -DWANT_EXAMPLES=OFF -DWANT_DEMO=OFF -DCMAKE_BUILD_TYPE=Debug -DPNG_LIBRARY= /Users/me/Development/AOSP/external/libpng/libs/armeabi/  -DPNG_INCLUDE_DIR=/Users/me/Development/AOSP/external/libpng

CMake Error: The source directory "/Users/me/Development/AOSP/external/libpng/libs/armeabi/" is a file, not a directory.
 Specify --help for usage, or press the help button on the CMake GUI.

So then I try....

ccmake .. -DANDROID_NDK_TOOLCHAIN_ROOT=$TC -DWANT_ANDROID=on  -DWANT_EXAMPLES=OFF -DWANT_DEMO=OFF -DCMAKE_BUILD_TYPE=Debug -DPNG_LIBRARY= /Users/me/Development/AOSP/external/libpng/libs/armeabi  -DPNG_INCLUDE_DIR=/Users/me/Development/AOSP/external/libpng

CMake Error: The source directory "/Users/me/Development/AOSP/external/libpng/libs/armeabi" does not appear to contain CMakeLists.txt.
 Specify --help for usage, or press the help button on the CMake GUI.

Any ideas what I am doing wrong?


Extra space dope :P

Ok But now

CMake Warning:
Manually-specified variables were not used by the project:


And I don't see png anywhere in the install. It will take me some time to test but does it look right?

Thread #613071. Printed from