X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6c37f5bc40dc01ba7a0db6c50a79d88bdd028c7..b6963858fbc0a1fc82538b86d20245ace9db9449:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index 0cb1adf788..ebb8931854 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -2450,7 +2450,17 @@ bool wxImage::DoLoad(wxImageHandler& handler, wxInputStream& stream, int index) } if ( width != widthOrig || height != heightOrig ) + { + // get the original size if it was set by the image handler + // but also in order to restore it after Rescale + int widthOrigOption = GetOptionInt(wxIMAGE_OPTION_ORIGINAL_WIDTH), + heightOrigOption = GetOptionInt(wxIMAGE_OPTION_ORIGINAL_HEIGHT); + Rescale(width, height, wxIMAGE_QUALITY_HIGH); + + SetOption(wxIMAGE_OPTION_ORIGINAL_WIDTH, widthOrigOption ? widthOrigOption : widthOrig); + SetOption(wxIMAGE_OPTION_ORIGINAL_HEIGHT, heightOrigOption ? heightOrigOption : heightOrig); + } } // Set this after Rescale, which currently does not preserve it