added support for reading resolution information from TIFF, JPEG and BMP formats; corrected some bugs with saving resolution; added command allowing to see the image resolution (if available) to the sample (heavily modified patch 1790546)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -310,6 +310,17 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
}
|
||||
}
|
||||
|
||||
// set up resolution if available: it's part of optional JFIF APP0 chunk
|
||||
if ( cinfo.saw_JFIF_marker )
|
||||
{
|
||||
image->SetOption(wxIMAGE_OPTION_RESOLUTIONX, cinfo.X_density);
|
||||
image->SetOption(wxIMAGE_OPTION_RESOLUTIONY, cinfo.Y_density);
|
||||
|
||||
// we use the same values for this option as libjpeg so we don't need
|
||||
// any conversion here
|
||||
image->SetOption(wxIMAGE_OPTION_RESOLUTIONUNIT, cinfo.density_unit);
|
||||
}
|
||||
|
||||
jpeg_finish_decompress( &cinfo );
|
||||
jpeg_destroy_decompress( &cinfo );
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user