DALi Version 1.2.61
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / image-loader / sync-image-loader.cpp
index de489dc..e8f8ad7 100644 (file)
@@ -16,7 +16,7 @@
 
 // CLASS HEADER
 #include "sync-image-loader.h"
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
 
 
 namespace Dali
@@ -45,12 +45,13 @@ PixelData Load( const std::string& url,
                 SamplingMode::Type samplingMode,
                 bool orientationCorrection )
 {
-  BitmapLoader loader = BitmapLoader::New( url, dimensions, fittingMode, samplingMode, orientationCorrection );
-
   // Load the image synchronously (block the thread here).
-  loader.Load();
-
-  return loader.GetPixelData();
+  Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile( url, dimensions, fittingMode, samplingMode, orientationCorrection );
+  if( pixelBuffer )
+  {
+    return Devel::PixelBuffer::Convert( pixelBuffer );
+  }
+  return Dali::PixelData(); // return empty handle
 }