marinofaggiana 4 yıl önce
ebeveyn
işleme
6a12c94b1f

+ 10 - 5
iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

@@ -415,15 +415,20 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
     }
 
     func pastePasteboard(serverUrl: String) {
-                
+        
+        var typeDataSaved = [String: Data]()
+        
         for (index, items) in UIPasteboard.general.items.enumerated() {
             for item in items {
                 let contentType = item.key
                 if let data = UIPasteboard.general.data(forPasteboardType: contentType, inItemSet: IndexSet([index]))?.first {
-                    let type = NCCommunicationCommon.shared.convertUTItoResultType(fileUTI: contentType as CFString)
-                    if type.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue && type.resultExtension != "" {
-                        uploadPasteFile(fileName: type.resultFilename, ext: type.resultExtension, contentType: contentType, serverUrl: serverUrl, data: data)
-                    }
+                    typeDataSaved[contentType] = data
+                }
+            }
+            for (contentType,data) in typeDataSaved {
+                let results = NCCommunicationCommon.shared.convertUTItoResultType(fileUTI: contentType as CFString)
+                if results.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue {
+                    uploadPasteFile(fileName: results.resultFilename, ext: results.resultExtension, contentType: contentType, serverUrl: serverUrl, data: data)
                 }
             }
         }

+ 9 - 0
iOSClient/Viewer/NCViewerProviderContextMenu.swift

@@ -275,4 +275,13 @@ class NCViewerProviderContextMenu: UIViewController  {
         let size = track.naturalSize.applying(track.preferredTransform)
         return CGSize(width: abs(size.width), height: abs(size.height))
     }
+    
+    private func resizeImage(_ image: UIImage) -> UIImage {
+        if (image.size.width <= image.size.height) && (image.size.width >= UIScreen.main.bounds.width) {
+            if let image = image.resizeImage(size: CGSize(width: UIScreen.main.bounds.width/2, height: UIScreen.main.bounds.height/2), isAspectRation: true) {
+                return image
+            }
+        }
+        return image
+    }
 }