Skip to content

Commit

Permalink
Twain: Always set ICAP_BITDEPTH
Browse files Browse the repository at this point in the history
The spec recommends always setting ICAP_PIXELTYPE and ICAP_BITDEPTH as there is no guaranteed default value. (thanks Alec Skelly)
  • Loading branch information
cyanfish committed Mar 18, 2024
1 parent fc58f48 commit b4dc656
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NAPS2.Sdk/Scan/Internal/Twain/TwainScanRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,11 @@ private void ConfigureSource(DataSource source)
break;
case BitDepth.Grayscale:
source.Capabilities.ICapPixelType.SetValue(PixelType.Gray);
source.Capabilities.ICapBitDepth.SetValue(8);
break;
case BitDepth.BlackAndWhite:
source.Capabilities.ICapPixelType.SetValue(PixelType.BlackWhite);
source.Capabilities.ICapBitDepth.SetValue(1);
break;
}

Expand Down

0 comments on commit b4dc656

Please sign in to comment.