|
@@ -36,11 +36,24 @@ open class PQImageFilter: PQBaseFilter {
|
|
|
|
|
|
mSticker = sticker
|
|
|
stickerInfo = sticker
|
|
|
- if mSticker!.locationPath.count == 0 {
|
|
|
- BFLog(2, message: "图片数据为空,创建失败")
|
|
|
- return
|
|
|
+
|
|
|
+
|
|
|
+ if(sticker.originalData != nil && (sticker.originalData?.count ?? 0) > 0){
|
|
|
+ newImage = UIImage.init(data: sticker.originalData!)
|
|
|
+ }else{
|
|
|
+ if mSticker!.locationPath.count == 0 {
|
|
|
+ BFLog(2, message: "图片数据为空,创建失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var imageFilePath = mSticker?.locationPath ?? ""
|
|
|
+ if (!imageFilePath.contains("var/mobile/Media")) {
|
|
|
+ imageFilePath = documensDirectory + imageFilePath
|
|
|
+ }
|
|
|
+ BFLog(message: "imageFilePath is \(imageFilePath)")
|
|
|
+ newImage = UIImage(contentsOfFile:imageFilePath)
|
|
|
}
|
|
|
- newImage = UIImage(contentsOfFile: documensDirectory + sticker.locationPath)
|
|
|
+
|
|
|
// try find image file frome in BFFramework bundle
|
|
|
if newImage == nil {
|
|
|
newImage = UIImage.moduleImage(named: sticker.locationPath, moduleName: "BFFramework", isAssets: false)
|
|
@@ -55,7 +68,7 @@ open class PQImageFilter: PQBaseFilter {
|
|
|
|
|
|
autoreleasepool {
|
|
|
if newImage == nil {
|
|
|
-
|
|
|
+ //有可能是webp数据 ,使用 webp 加载
|
|
|
var imageFilePath = mSticker?.locationPath ?? ""
|
|
|
if (!imageFilePath.contains("var/mobile/Media")) {
|
|
|
imageFilePath = documensDirectory + imageFilePath
|