Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » al_load_bitmap only loads specific bitmaps

This thread is locked; no one can reply to it. rss feed Print
al_load_bitmap only loads specific bitmaps
DuncanShine
Member #17,479
March 2020

I'm trying to use al_load_bitmap with some files i created, and whenever i try and use the one i made it will spit out an assertion error and the program crashes but for some reason whenever i try it with a random image it works perfectly fine

LennyLen
Member #5,313
December 2004
avatar

Can you attach the bitmap in question and also provide minimal source code that has the problem. Then someone can probably help you.

MikiZX
Member #17,092
June 2019

What LennyLen said. Also, I believe you are trying to understand the problem so you could avoid it in the future - since, possibly a workaround to this issue is to open the image in question in a software like MS Paint or IrfanView and save it under a differnt format (PNG, ...) and then try opening this converted image using Allegro.
Also please specify does the crash happen at loading time or only on drawing? If it is at drawing time then include in your program (after the loading bit) a check that will verify that the loaded bitmap is not NULL.

Go to: