Skip to content

Commit

Permalink
Merge pull request #1123 from kryptogo/master
Browse files Browse the repository at this point in the history
Fix takeScreenshot Crash on iOS
  • Loading branch information
pichillilorenzo authored Apr 17, 2022
2 parents 194106b + 47ef668 commit 5079342
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Classes/InAppWebView/InAppWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5079342

Please sign in to comment.