#include <msp/core/refptr.h>
#include <msp/io/file.h>
#include <msp/strings/format.h>
+#include <msp/strings/utils.h>
#include "bmploader.h"
#include "imageloader.h"
#ifdef WITH_LIBPNG
{
string sig_hex;
for(unsigned i=0; i<sig_len; ++i)
- {
- if(i)
- sig_hex += ' ';
- sig_hex += format("%02X", static_cast<unsigned char>(sig_buf[i]));
- }
+ append(sig_hex, " ", format("%02X", static_cast<unsigned char>(sig_buf[i])));
throw unsupported_image_format(sig_hex);
}
if(state<HEADERS_LOADED)
load_headers_(data);
+ if(!data.pixels)
+ data.pixels = data.owned_pixels = new char[data.stride*data.height];
load_pixels_(data);
state = FINISHED;
}