Merge pull request #1123 from kryptogo/master
Fix takeScreenshot Crash on iOS
This commit is contained in:
commit
50793429d7
@ -674,17 +674,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…
x
Reference in New Issue
Block a user