+
+ uint16 spp, bpp, compression;
+ /*
+ Read some baseline TIFF tags which helps when re-saving a TIFF
+ to be similar to the original image.
+ */
+ if ( TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &spp) )
+ {
+ image->SetOption(wxIMAGE_OPTION_SAMPLESPERPIXEL, spp);
+ }
+
+ if ( TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bpp) )
+ {
+ image->SetOption(wxIMAGE_OPTION_BITSPERSAMPLE, bpp);
+ }
+
+ if ( TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compression) )
+ {
+ image->SetOption(wxIMAGE_OPTION_COMPRESSION, compression);
+ }
+
+ // Set the resolution unit.
+ wxImageResolution resUnit = wxIMAGE_RESOLUTION_NONE;