in Legacy/PlaygroundLogger/PlaygroundLogger/ImageHandler.swift [59:71]
func PNGRepresentation(_ x: AnyObject) -> Data? {
if let ui_image = x as? UIImage {
if ui_image.cgImage == nil {
if let ci_image = ui_image.ciImage {
return CI2Data(ci_image) { return UIImagePNGRepresentation($0!) }
}
} else { return UIImagePNGRepresentation(ui_image) }
}
else if let ci_image = x as? CIImage {
return CI2Data(ci_image) { return UIImagePNGRepresentation($0!) }
}
return nil
}