fix takeScreenshot crash
This commit is contained in:
parent
f06bcdf695
commit
47ef668273
|
@ -670,17 +670,17 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
|
|||
switch with["compressFormat"] as! String {
|
||||
case "JPEG":
|
||||
let quality = Float(with["quality"] as! Int) / 100
|
||||
imageData = screenshot.jpegData(compressionQuality: CGFloat(quality))!
|
||||
imageData = screenshot.jpegData(compressionQuality: CGFloat(quality))
|
||||
break
|
||||
case "PNG":
|
||||
imageData = screenshot.pngData()!
|
||||
imageData = screenshot.pngData()
|
||||
break
|
||||
default:
|
||||
imageData = screenshot.pngData()!
|
||||
imageData = screenshot.pngData()
|
||||
}
|
||||
}
|
||||
else {
|
||||
imageData = screenshot.pngData()!
|
||||
imageData = screenshot.pngData()
|
||||
}
|
||||
}
|
||||
completionHandler(imageData)
|
||||
|
|
Loading…
Reference in New Issue