X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af58844636f51ca9c9350c66de3baf427d3e8646..66f75561893ea7b4bf429d1882d9cc0407ba932d:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index abe155c880..32845b9afe 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -25,6 +25,7 @@ #if wxUSE_IMAGE && wxUSE_LIBPNG #include "wx/imagpng.h" +#include "wx/versioninfo.h" #ifndef WX_PRECOMP #include "wx/log.h" @@ -387,7 +388,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 @@ -455,7 +456,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 @@ -781,7 +782,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 ) @@ -828,7 +829,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: @@ -902,4 +903,18 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos #endif // wxUSE_STREAMS +/*static*/ wxVersionInfo wxPNGHandler::GetLibraryVersionInfo() +{ + // The version string seems to always have a leading space and a trailing + // new line, get rid of them both. + wxString str = png_get_header_version(NULL) + 1; + str.Replace("\n", ""); + + return wxVersionInfo("libpng", + PNG_LIBPNG_VER_MAJOR, + PNG_LIBPNG_VER_MINOR, + PNG_LIBPNG_VER_RELEASE, + str); +} + #endif // wxUSE_LIBPNG