#include <dali/public-api/common/compile-time-assert.h>
#include <dali/integration-api/debug.h>
#include <adaptors/devel-api/adaptor-framework/pixel-buffer.h>
+#include <adaptors/common/pixel-buffer-impl.h>
namespace Dali
{
// Load up the image bytes:
bitmap = Dali::Devel::PixelBuffer::New(width, height, pixelFormat);
+
+ // Compressed format won't allocate the buffer
auto pixels = bitmap.GetBuffer();
+ if( !pixels )
+ {
+ // allocate buffer manually
+ auto &impl = GetImplementation(bitmap);
+ impl.AllocateFixedSize(imageByteCount);
+ pixels = bitmap.GetBuffer();
+ }
if(!pixels)
{
DALI_LOG_ERROR( "Unable to reserve a pixel buffer to load the requested bitmap into.\n" );
return false;
}
+
const size_t bytesRead = fread(pixels, 1, imageByteCount, fp);
if(bytesRead != imageByteCount)
{