marinofaggiana il y a 3 ans
Parent
commit
ded83a2c3e

+ 2 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -627,8 +627,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 var image = NCUtility.shared.loadImage(named: "person.crop.circle")
                 let fileName = String(CCUtility.getUserUrlBase(appDelegate.user, urlBase: appDelegate.urlBase)) + "-" + appDelegate.user + ".png"
                 let fileNamePath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
-                if let userImage = UIImage(contentsOfFile: fileNamePath) {
-                    image = userImage
+                if let userImage = UIImage(contentsOfFile: fileNamePath), let avatarImage = userImage.resizeImage(size: CGSize(width: 30, height: 30), isAspectRation: true) {
+                    image = avatarImage
                 }
                                 
                 let button = UIButton(type: .custom)

+ 2 - 1
iOSClient/Networking/NCOperationQueue.swift

@@ -173,9 +173,10 @@ import NCCommunication
         }
         #endif
                 
-        cell.fileAvatarImageView?.image = placeholder
         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
             cell.fileAvatarImageView?.image = image
+        } else {
+            cell.fileAvatarImageView?.image = placeholder
         }
         
         downloadAvatarQueue.addOperation(NCOperationDownloadAvatar.init(user: user, fileName: fileName, fileNameLocalPath: fileNameLocalPath, cell: cell, view: view))