1
Fork 0

Fix byte order preventing some masks from being created

This commit is contained in:
Joshua Goins 2022-11-21 11:34:39 -05:00
parent fa70f9094b
commit 18392104cd

View file

@ -201,7 +201,14 @@ class Document: NSDocument {
let render: CGColorRenderingIntent = .defaultIntent
let rgbColorSpace = isMask ? CGColorSpaceCreateDeviceGray() : info.colorSpace
let bitmapInfo = CGBitmapInfo(rawValue: (isMask ? CGImageAlphaInfo.none : CGImageAlphaInfo.premultipliedLast).rawValue).union(.byteOrder32Big)
var bitmapInfo = CGBitmapInfo(rawValue: (isMask ? CGImageAlphaInfo.none : CGImageAlphaInfo.premultipliedLast).rawValue)
if isMask {
bitmapInfo = bitmapInfo.union(.byteOrderDefault)
} else {
bitmapInfo = bitmapInfo.union(.byteOrder32Big)
}
let providerRef: CGDataProvider? = CGDataProvider(data: imageData as CFData)
guard let cgimage = CGImage(width: tileWidth,