|
@@ -381,12 +381,8 @@ class KMWatermarkManager: NSObject {
|
|
|
|
|
|
let isText: Bool = (dict.object(forKey: KMWatermarkKey.text.rawValue) != nil)
|
|
let isText: Bool = (dict.object(forKey: KMWatermarkKey.text.rawValue) != nil)
|
|
let isFile: Bool = (dict.object(forKey: KMWatermarkKey.imagePath.rawValue) != nil)
|
|
let isFile: Bool = (dict.object(forKey: KMWatermarkKey.imagePath.rawValue) != nil)
|
|
- if (isText) {
|
|
|
|
- model.text = (dict.object(forKey: KMWatermarkKey.text.rawValue) as! String)
|
|
|
|
- let fontSize: CGFloat = dict.object(forKey: KMWatermarkKey.textFontSize.rawValue) as! CGFloat
|
|
|
|
-// let fontName: String = dict.object(forKey: KMWatermarkKey.textFontName.rawValue) as! String
|
|
|
|
- model.textFont = .font(name: "Helvetica", size: fontSize)
|
|
|
|
- } else if (isFile) {
|
|
|
|
|
|
+
|
|
|
|
+ if (isFile) {
|
|
let path = watermarkFolderPath?.stringByAppendingPathComponent(dict.object(forKey: KMWatermarkKey.imagePath.rawValue) as! String)
|
|
let path = watermarkFolderPath?.stringByAppendingPathComponent(dict.object(forKey: KMWatermarkKey.imagePath.rawValue) as! String)
|
|
if (FileManager.default.fileExists(atPath: path!)) {
|
|
if (FileManager.default.fileExists(atPath: path!)) {
|
|
model.image = NSImage(contentsOfFile: path!)
|
|
model.image = NSImage(contentsOfFile: path!)
|
|
@@ -394,6 +390,11 @@ class KMWatermarkManager: NSObject {
|
|
} else {
|
|
} else {
|
|
model.image = nil
|
|
model.image = nil
|
|
}
|
|
}
|
|
|
|
+ } else if (isText) {
|
|
|
|
+ model.text = (dict.object(forKey: KMWatermarkKey.text.rawValue) as! String)
|
|
|
|
+ let fontSize: CGFloat = dict.object(forKey: KMWatermarkKey.textFontSize.rawValue) as! CGFloat
|
|
|
|
+// let fontName: String = dict.object(forKey: KMWatermarkKey.textFontName.rawValue) as! String
|
|
|
|
+ model.textFont = .font(name: "Helvetica", size: fontSize)
|
|
}
|
|
}
|
|
|
|
|
|
model.scale = (dict.object(forKey: KMWatermarkKey.scale.rawValue) as? CGFloat) ?? 1
|
|
model.scale = (dict.object(forKey: KMWatermarkKey.scale.rawValue) as? CGFloat) ?? 1
|