Cocos2dx 3.0 rc0 doesn't support BMP format image


#1

It throws exception “unsupport image format!” after loading a .bmp format image.
And also i can’t find BMP define in CCImage.h

enum class Format
    {
        //! JPEG
        JPG,
        //! PNG
        PNG,
        //! TIFF
        TIFF,
        //! WebP
        WEBP,
        //! PVR
        PVR,
        //! ETC
        ETC,
        //! S3TC
        S3TC,
        //! ATITC
        ATITC,
        //! TGA
        TGA,
        //! Raw Data
        RAW_DATA,
        //! Unknown format
        UNKOWN
    };

is this intended or mistakes?


#2

Just convert the image to png.


#3

why would you use bmp for anything?


#4

@Wuhao I am dealing with some old user uploaded images with variety formats, some of them are BMPs.


#5

here is my situation.i use android ndk r8e + cocos2dx-2.2.2 + ccsprite and i can’t use any bmp in my code.but in the ios with cocos2dx-2.2.2,it can display bmp in menuitem.when i go to the souce code,all goes to ccimage.there are png,jpg but no bmp,wierd,h?


#6

This is vital! For example when you get images from the web - you cant convert then that easy. You need some another graphics library to detect its format, then in case of BMP you convert it and only then pass to cocos. It is impossible, for example, to show facebook avatars as some of them (old ones) can be in BMP and cocos just crash with Assert there (im talking about ccp version).