diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 76d4532725..ff95ab1374 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -200,8 +200,8 @@ bool wxBMPHandler::SaveDib(wxImage *image, case wxIMAGE_RESOLUTION_INCHES: // convert resolution in inches to resolution in centimeters - hres *= 100*mm2inches; - vres *= 100*mm2inches; + hres = (wxUint32)(100*mm2inches*hres); + vres = (wxUint32)(100*mm2inches*vres); // fall through to convert it to resolution in meters case wxIMAGE_RESOLUTION_CM: diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 49c76fba7c..c956f6e2d1 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -373,10 +373,10 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos { float xres, yres; if ( TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) ) - image->SetOption(wxIMAGE_OPTION_RESOLUTIONX, xres); + image->SetOption(wxIMAGE_OPTION_RESOLUTIONX, wxRound(xres)); if ( TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) ) - image->SetOption(wxIMAGE_OPTION_RESOLUTIONY, yres); + image->SetOption(wxIMAGE_OPTION_RESOLUTIONY, wxRound(yres)); } }