- if(fp == NULL)
- {
- DALI_LOG_ERROR("Error loading bitmap\n");
- return false;
- }
- Dali::Vector<unsigned char> map;
- size_t position = 0;
-
- unsigned int w, h;
- unsigned int type;
- if(fseek(fp, 0, SEEK_END))
- {
- DALI_LOG_ERROR("Error seeking WBMP data\n");
- return false;
- }
- long positionIndicator = ftell(fp);
-
- unsigned int fsize(0u);
- if(positionIndicator > -1L)
- {
- fsize = static_cast<unsigned int>(positionIndicator);
- }
-
- if(0u == fsize)
- {
- return false;
- }
-
- if(fseek(fp, 0, SEEK_SET))
- {
- DALI_LOG_ERROR("Error seeking WBMP data\n");
- return false;
- }
- if(fsize <= 4)
- {
- DALI_LOG_ERROR("Error: WBMP Raw Data Not Found!\n");
- return false;
- }
-
- // type(1 byte) + fixedheader(1 byte) + width(uint) + height(uint)
- unsigned int headerSize = 1 + 1 + 4 + 4; // 8 + 8 + 32 + 32;
- headerSize = std::min(headerSize, fsize);