Skip to content

Commit c2ea51a

Browse files
authored
fix: fix a crash for 48 bits bitmap (#423)
1 parent 2f694f5 commit c2ea51a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Mantis/Extensions/CGImageExtensions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ extension CGImage {
8989
/* Convert a 10-bit image to a 16-bit image to preserve accuracy.
9090
Since we haven't successfully created a 10-bit image CGContext yet, we're temporarily using this method.
9191
*/
92-
if (32, 10) == (bitsPerPixel, bitsPerComponent) {
92+
if (32, 10) == (bitsPerPixel, bitsPerComponent)
93+
|| (48, 16) == (bitsPerPixel, bitsPerComponent) {
9394
actualBitsPerComponent = 16
9495
actualBitmapBytesPerRow = Int(round(size.width)) * 8
9596
}

0 commit comments

Comments
 (0)