Wia: Add debug logging for dpi changes

This commit is contained in:
Ben Olden-Cooligan 2024-03-03 12:45:52 -08:00
parent ea4a695b63
commit 1a0583a38a

View File

@ -347,6 +347,10 @@ internal class WiaScanDriver : IScanDriver
int yRes = _options.Dpi;
SafeSetPropertyClosest(item, WiaPropertyId.IPS_XRES, ref xRes);
SafeSetPropertyClosest(item, WiaPropertyId.IPS_YRES, ref yRes);
if (xRes != _options.Dpi || yRes != _options.Dpi)
{
_logger.LogDebug($"Correcting DPI from {_options.Dpi}x{_options.Dpi} to {xRes}x{yRes}");
}
int pageWidth = _options.PageSize!.WidthInThousandthsOfAnInch * xRes / 1000;
int pageHeight = _options.PageSize.HeightInThousandthsOfAnInch * yRes / 1000;