|
@@ -67,7 +67,9 @@ open class PQTextFilter: PQBaseFilter {
|
|
let size: CGSize = subtitleLab.bounds.size
|
|
let size: CGSize = subtitleLab.bounds.size
|
|
//如果传0,则这个参数会用设备的scale,
|
|
//如果传0,则这个参数会用设备的scale,
|
|
UIGraphicsBeginImageContextWithOptions(size, false, 2)
|
|
UIGraphicsBeginImageContextWithOptions(size, false, 2)
|
|
- subtitleLab.layer.render(in: UIGraphicsGetCurrentContext()!)
|
|
|
|
|
|
+ if let context = UIGraphicsGetCurrentContext() {
|
|
|
|
+ subtitleLab.layer.render(in: context)
|
|
|
|
+ }
|
|
|
|
|
|
self?.subtitleImage = UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()
|
|
self?.subtitleImage = UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()
|
|
UIGraphicsEndImageContext()
|
|
UIGraphicsEndImageContext()
|