marinofaggiana 3 years ago
parent
commit
a4bb4706e3

+ 4 - 16
iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift

@@ -104,29 +104,17 @@ class NCViewerMediaDetailView: UIView {
         
         if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
             CCUtility.setExif(metadata) { (latitude, longitude, location, date, lensMode) in
+                
                 self.latitude = latitude
                 self.longitude = longitude
                 self.location = location
                 self.date = date as NSDate?
+                
                 self.updateContent()
             };
+        } else {
+            self.updateContent()
         }
-    
-        if let localFile = NCManageDatabase.shared.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)) {
-            
-            let latitudeString = localFile.exifLatitude
-            let longitudeString = localFile.exifLongitude
-            self.latitude = Double(localFile.exifLatitude) ?? 0
-            self.longitude = Double(localFile.exifLongitude) ?? 0
-            self.date = localFile.exifDate
-            self.lensModel = localFile.exifLensModel
-            
-            if let locationDB = NCManageDatabase.shared.getLocationFromGeoLatitude(latitudeString, longitude: longitudeString) {
-                location = locationDB
-            }
-        }
-        
-        self.updateContent()
     }
     
     //MARK: - Map

+ 8 - 4
iOSClient/Viewer/NCViewerMedia/NCViewerMediaZoom.swift

@@ -191,16 +191,20 @@ class NCViewerMediaZoom: UIViewController {
     @objc func didPanWith(gestureRecognizer: UIPanGestureRecognizer) {
                 
         let currentLocation = gestureRecognizer.translation(in: self.view)
+        let velocity = gestureRecognizer.velocity(in: self.view)
         
         switch gestureRecognizer.state {
         
         case .began:
             
-            var heightMap = (view.bounds.height / 3)
-            if view.bounds.width < view.bounds.height {
-                heightMap = (view.bounds.width / 3)
+            // gesture moving Up
+            if velocity.y < 0 {
+                var heightMap = (view.bounds.height / 3)
+                if view.bounds.width < view.bounds.height {
+                    heightMap = (view.bounds.width / 3)
+                }
+                detailView.update(metadata: metadata, image: image, heightMap: heightMap)
             }
-            detailView.update(metadata: metadata, image: image, heightMap: heightMap)
 
         case .ended: