]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
removing duplicated method, wiring native maxlength support, see #10269
[wxWidgets.git] / src / common / image.cpp
index 0cb1adf7886f143d508fd58617e1b0260fbb89fa..62597542fd95dfaf2c759b93a8664c498486ccfd 100644 (file)
@@ -142,6 +142,7 @@ bool wxImage::Create(const char* const* xpmData)
     (*this) = decoder.ReadData(xpmData);
     return IsOk();
 #else
+    wxUnusedVar(xpmData);
     return false;
 #endif
 }
@@ -2450,7 +2451,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