Procházet zdrojové kódy

【综合】批量转图片,部分crash问题修复

tangchao před 1 rokem
rodič
revize
5afeea34ce

+ 1 - 1
PDF Office/PDF Master/Class/Batch/Data/KMBatchConvertParameter.swift

@@ -60,7 +60,7 @@ class KMBatchConvertParameter: KMBatchBaseParameter {
     override func fetchDestinationFilepath() -> String? {
         if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0{
             if self.convertType == .JPEG || self.convertType == .CSV || self.convertType == .JPG  || self.convertType == .PNG || self.convertType == .GIF || self.convertType == .TIFF || self.convertType == .TGA || self.convertType == .BMP || self.convertType == .JPEG2000{
-                self.outPutPath = self.getUniqueFilePath(filePath: self.savePath!.stringByAppendingPathComponent(self.operateFile!.filePath.lastPathComponent.deletingPathExtension))
+                self.outPutPath = self.getUniqueFilePath(filePath: self.savePath!.stringByAppendingPathComponent(self.operateFile!.filePath.deletingPathExtension.lastPathComponent))
                 if self.operateFile?.CSVParameter.isExtreactTabel ?? false {
                     self.outPutPath = (self.outPutPath! as NSString).appendingPathExtension("zip")
                     self.outPutPath = self.getUniqueFilePath(filePath: self.outPutPath ?? "")

+ 1 - 1
PDF Office/PDF Master/Class/Batch/Operation/KMBatchConvertOperation.swift

@@ -153,7 +153,7 @@ class KMBatchConvertOperation: KMBatchOperation, CPDFConverterDelegate, CPDFConv
                 self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
                 return
             }
-            let op: [String:Any] = [CPDFConvertOptionsKey.imageDPI.rawValue:operateFile?.dpi as Any,CPDFConvertOptionsKey.allInOneSheet.rawValue:operateFile?.currentConvertParameter?.allInOneSheet as Any]
+            let op: [String:Any] = [CPDFConvertOptionsKey.imageDPI.rawValue:operateFile?.dpi as Any,CPDFConvertOptionsKey.allInOneSheet.rawValue:(operateFile?.currentConvertParameter?.allInOneSheet ?? false)]
             self.fpPDFConverter = CPDFConverterFP()
             self.fpPDFConverter?.convertPDF(atPath: operateFile?.filePath, pdfPassword: operateFile?.password, pdfPageIndexs: operateFile?.currentConvertParameter?.pagesArray, destDocType: operateFile?.currentConvertParameter?.extensionString(), destDocPath: operateFile?.outputFilePath, moreOptions:op)