 //        if(backCameraDevice?.flashAvailable){
 //            setFlashModeToAuto(backCameraDevice!)
 //        }
-
+        UIDevice.currentDevice().setValue(oldOrientationValue.rawValue, forKey: "orientation")
         delegate!.cameraFinished(self, JSON: pathJSON)
     }
 

    func beginSession(){
        let currentDevice: UIDevice = UIDevice.currentDevice()
        var orientation: UIDeviceOrientation = currentDevice.orientation;
        var width = UIScreen.mainScreen().bounds.size.width;
        var height = UIScreen.mainScreen().bounds.size.height;
        if(orientation == UIDeviceOrientation.LandscapeLeft ||

//        if(backCameraDevice?.flashAvailable){
//            setFlashModeToAuto(backCameraDevice!)
//        }
        UIDevice.currentDevice().setValue(oldOrientationValue.rawValue, forKey: "orientation")
        delegate!.cameraFinished(self, JSON: pathJSON)
    }

