Fix CFMutableData handling

This commit is contained in:
jack
2025-10-14 22:21:17 +02:00
parent 24cc307a0e
commit c7280284ea
+3 -1
View File
@@ -111,7 +111,9 @@ enum ImageUtils {
}
private static func encodeJPEG(from cgImage: CGImage, quality: CGFloat) -> Data? {
let data = CFDataCreateMutable(nil, 0)
guard let data = CFDataCreateMutable(nil, 0) else {
return nil
}
guard let destination = CGImageDestinationCreateWithData(data, UTType.jpeg.identifier as CFString, 1, nil) else {
return nil
}