]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpng.cpp
Added ComputeHistogram
[wxWidgets.git] / src / common / imagpng.cpp
index e8d9f42c7e304768d27b5905fae5fb8d6a8cb14c..6a71a8c263383aecf003037b487399a89daab170 100644 (file)
@@ -53,9 +53,7 @@
 // wxPNGHandler
 //-----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler)
-#endif
 
 #if wxUSE_LIBPNG
 
@@ -167,6 +165,7 @@ bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
     {
         int transp = 0;
         png_read_image( png_ptr, lines );
+        png_read_end( png_ptr, info_ptr );
         png_destroy_read_struct( &png_ptr, &info_ptr, (png_infopp) NULL );
         unsigned char *ptr = image->GetData();
         if ((color_type == PNG_COLOR_TYPE_GRAY) ||
@@ -243,7 +242,8 @@ bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
  error_nolines:
     lines = NULL; // called from before it was set
  error:
-    wxLogError(_("Couldn't load a PNG image - probably file is corrupted."));
+    if (verbose)
+       wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory."));
 
     if ( image->Ok() )
     {