png_structp png_ptr = png_create_read_struct
(
PNG_LIBPNG_VER_STRING,
- (voidp) NULL,
+ NULL,
wx_png_error,
wx_png_warning
);
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;