Merge pull request #1123 from kryptogo/master

Fix takeScreenshot Crash on iOS
This commit is contained in:
Lorenzo Pichilli 2022-04-18 01:08:39 +02:00 committed by GitHub
commit 50793429d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)