[3.0] Fix native image capture code and DALi image saving
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / image-loaders / loader-wbmp.cpp
index 8014bc6..f042ce7 100755 (executable)
@@ -82,7 +82,7 @@ int extractMultiByteInteger(unsigned int *data, void *map, size_t length, size_t
 
     if ((buf & 0x80) == 0)
     {
-      DALI_LOG_INFO(gLogFilter, Debug::Verbose, "position: %d, readBufCount: %d", *position, readBufCount);
+      DALI_LOG_INFO(gLogFilter, Debug::Verbose, "position: %d, readBufCount: %d\n", *position, readBufCount);
       break;
     }
   }
@@ -149,7 +149,7 @@ bool LoadBitmapFromWbmp( const ResourceLoadingClient& client, const ImageLoader:
 
   if(fread(&map[0], 1, fsize, fp) != fsize)
   {
-    DALI_LOG_WARNING("image file read opeation error!");
+    DALI_LOG_WARNING("image file read opeation error!\n");
     return false;
   }
 
@@ -263,13 +263,13 @@ bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsig
   map.Resize(headerSize);
   if(fread(&map[0], 1, headerSize, fp) != headerSize)
   {
-    DALI_LOG_WARNING("image file read opeation error!");
+    DALI_LOG_WARNING("image file read opeation error!\n");
     return false;
   }
 
-  if (extractMultiByteInteger(&type, &map[0], fsize, &position) < 0)
+  if (extractMultiByteInteger(&type, &map[0], headerSize, &position) < 0)
   {
-    DALI_LOG_ERROR("Error: unable to read type!");
+    DALI_LOG_ERROR("Error: unable to read type!\n");
     return false;
   }
   position++; /* skipping one byte */
@@ -278,12 +278,12 @@ bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsig
     DALI_LOG_ERROR("Error: unknown format!\n");
     return false;
   }
-  if (extractMultiByteInteger(&w, &map[0], fsize, &position) < 0)
+  if (extractMultiByteInteger(&w, &map[0], headerSize, &position) < 0)
   {
     DALI_LOG_ERROR("Error: can not read width!\n");
     return false;
   }
-  if (extractMultiByteInteger(&h, &map[0], fsize, &position) < 0)
+  if (extractMultiByteInteger(&h, &map[0], headerSize, &position) < 0)
   {
     DALI_LOG_ERROR("Error: can not read height!\n");
     return false;