X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/817b3d0e78fa6c1e3d862e8a7464be8aa66ccd80..17d98558b35b75e3cad68d96841b4fa5a0c7e6ee:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 83446867ad..14fd9eddb1 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -165,7 +165,9 @@ PNGLINKAGEMODE wx_png_warning(png_structp png_ptr, png_const_charp message) { wxPNGInfoStruct *info = png_ptr ? WX_PNG_INFO(png_ptr) : NULL; if ( !info || info->verbose ) + { wxLogWarning( wxString::FromAscii(message) ); + } } // from pngerror.c @@ -385,7 +387,7 @@ void CopyDataFromPNG(wxImage *image, // must be opaque then as otherwise we shouldn't be // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); + wxASSERT_MSG( IsOpaque(a), wxT("logic error") ); // fall through @@ -453,7 +455,7 @@ void CopyDataFromPNG(wxImage *image, { // must be opaque then as otherwise we shouldn't be // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); + wxASSERT_MSG( IsOpaque(a), wxT("logic error") ); // if we couldn't find a unique colour for the // mask, we can have real pixels with the same @@ -608,7 +610,9 @@ wxPNGHandler::LoadFile(wxImage *image, error: if (verbose) + { wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory.")); + } if ( image->Ok() ) { @@ -657,7 +661,9 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos if (!png_ptr) { if (verbose) + { wxLogError(_("Couldn't save PNG image.")); + } return false; } @@ -666,7 +672,9 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos { png_destroy_write_struct( &png_ptr, (png_infopp)NULL ); if (verbose) + { wxLogError(_("Couldn't save PNG image.")); + } return false; } @@ -674,7 +682,9 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos { png_destroy_write_struct( &png_ptr, (png_infopp)NULL ); if (verbose) + { wxLogError(_("Couldn't save PNG image.")); + } return false; } @@ -771,7 +781,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos break; default: - wxFAIL_MSG( _T("unsupported image resolution units") ); + wxFAIL_MSG( wxT("unsupported image resolution units") ); } if ( resX && resY ) @@ -818,7 +828,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos switch ( iColorType ) { default: - wxFAIL_MSG( _T("unknown wxPNG_TYPE_XXX") ); + wxFAIL_MSG( wxT("unknown wxPNG_TYPE_XXX") ); // fall through case wxPNG_TYPE_COLOUR: