Fix native image capture code and DALi image saving
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / image-loaders / loader-png.cpp
index 077d40c..7d19b56 100644 (file)
@@ -327,7 +327,6 @@ struct AutoPngWrite
   : png(_png),
     info(_info)
   {
-    DALI_ASSERT_DEBUG(&_png != 0 && &_info != 0);
   }
 
   ~AutoPngWrite()
@@ -367,18 +366,18 @@ namespace
       if(encoded_img)
       {
         const Vector<unsigned char>::SizeType bufferSize = encoded_img->Count();
-        encoded_img->Reserve( bufferSize + length ); //< Can throw OOM.
+        encoded_img->Resize( bufferSize + length ); //< Can throw OOM.
         unsigned char* const bufferBack = encoded_img->Begin() + bufferSize;
         memcpy(bufferBack, data, length);
       }
       else
       {
-        DALI_LOG_ERROR("PNG buffer for write to memory was passed from libpng as null.");
+        DALI_LOG_ERROR("PNG buffer for write to memory was passed from libpng as null.\n");
       }
     }
     catch(...)
     {
-      DALI_LOG_ERROR("C++ Exception caught");
+      DALI_LOG_ERROR("C++ Exception caught\n");
     }
   }
 
@@ -432,7 +431,7 @@ bool EncodeToPng( const unsigned char* const pixelBuffer, Vector<unsigned char>&
     }
     default:
     {
-      DALI_LOG_ERROR( "Unsupported pixel format for encoding to PNG." );
+      DALI_LOG_ERROR( "Unsupported pixel format for encoding to PNG.\n" );
       return false;
     }
   }