Added wxIMAGE_OPTION_ORIGINAL_{WIDTH,HEIGHT} wxImage options.
These options allow to retrieve the original image size if the image was scaled during load. Closes #13662. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -334,6 +334,13 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
image->SetOption(wxIMAGE_OPTION_RESOLUTIONUNIT, cinfo.density_unit);
|
||||
}
|
||||
|
||||
if ( cinfo.image_width != cinfo.output_width || cinfo.image_height != cinfo.output_height )
|
||||
{
|
||||
// save the original image size
|
||||
image->SetOption(wxIMAGE_OPTION_ORIGINAL_WIDTH, cinfo.image_width);
|
||||
image->SetOption(wxIMAGE_OPTION_ORIGINAL_HEIGHT, cinfo.image_height);
|
||||
}
|
||||
|
||||
jpeg_finish_decompress( &cinfo );
|
||||
jpeg_destroy_decompress( &cinfo );
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user