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 {
|
switch with["compressFormat"] as! String {
|
||||||
case "JPEG":
|
case "JPEG":
|
||||||
let quality = Float(with["quality"] as! Int) / 100
|
let quality = Float(with["quality"] as! Int) / 100
|
||||||
imageData = screenshot.jpegData(compressionQuality: CGFloat(quality))!
|
imageData = screenshot.jpegData(compressionQuality: CGFloat(quality))
|
||||||
break
|
break
|
||||||
case "PNG":
|
case "PNG":
|
||||||
imageData = screenshot.pngData()!
|
imageData = screenshot.pngData()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
imageData = screenshot.pngData()!
|
imageData = screenshot.pngData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
imageData = screenshot.pngData()!
|
imageData = screenshot.pngData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
completionHandler(imageData)
|
completionHandler(imageData)
|
||||||
|
|
Loading…
Reference in New Issue