X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/967956ddcf45090ff2c965d12b68ea0ef6bf9eae..7f37eded21431a8464cf4b59a39667ded9e5fc09:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 70e2a0abac..41b1378528 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -522,7 +522,7 @@ wxPNGHandler::LoadFile(wxImage *image, png_structp png_ptr = png_create_read_struct ( PNG_LIBPNG_VER_STRING, - (voidp) NULL, + NULL, wx_png_error, wx_png_warning ); @@ -774,6 +774,15 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos bool bUsePalette = false; #endif // wxUSE_PALETTE + /* + If saving palettised was requested but it was decided we can't use a + palette then reset the colour type to RGB. + */ + if (!bUsePalette && iColorType == wxPNG_TYPE_PALETTE) + { + iColorType = wxPNG_TYPE_COLOUR; + } + bool bUseAlpha = !bUsePalette && (bHasAlpha || bHasMask); png_color mask;