Skip to content

Commit

Permalink
Merge branch 'master' of gitlab.com:cyanfish/NAPS2
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Oct 14, 2023
2 parents 58a0405 + ef7614d commit cbff78a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NAPS2.Sdk/Scan/Internal/Apple/DeviceOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,16 @@ private void FlushImageDirectly(MemoryStream fullBuffer, ICScannerBandData data,
private void FlushImageWithColorSpace(MemoryStream fullBuffer, ICScannerBandData data)
{
var colorSpace = CGColorSpace.CreateIccData(NSData.FromFile(data.ColorSyncProfilePath!));
var flags = (data.BitsPerPixel == 32 ? CGBitmapFlags.NoneSkipLast : CGBitmapFlags.None) |
CGBitmapFlags.ByteOrderDefault;
var cgImage = new CGImage(
(int) data.FullImageWidth,
(int) data.FullImageHeight,
(int) data.BitsPerComponent,
(int) data.BitsPerPixel,
(int) data.BytesPerRow,
colorSpace,
CGBitmapFlags.None,
flags,
new CGDataProvider(fullBuffer.GetBuffer(), 0, (int) fullBuffer.Length),
null,
true,
Expand Down

0 comments on commit cbff78a

Please sign in to comment.