You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/04/08 21:21:10 UTC

[2/2] git commit: WP8 When only targetWidth or targetHeight is provided, use it as the only bound

WP8 When only targetWidth or targetHeight is provided, use it as the only bound


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/4c2c567f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/4c2c567f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/4c2c567f

Branch: refs/heads/dev
Commit: 4c2c567fd874a861d4707b1a5c2e268fb56f4d76
Parents: fe6dc72
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 8 12:19:44 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 8 12:19:44 2014 -0700

----------------------------------------------------------------------
 src/wp/Camera.cs | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/4c2c567f/src/wp/Camera.cs
----------------------------------------------------------------------
diff --git a/src/wp/Camera.cs b/src/wp/Camera.cs
index 87617e4..b76929b 100644
--- a/src/wp/Camera.cs
+++ b/src/wp/Camera.cs
@@ -197,6 +197,16 @@ namespace WPCordovaClassLib.Cordova.Commands
                 cameraOptions.AllowEdit = bool.Parse(args[7]);
                 cameraOptions.CorrectOrientation = bool.Parse(args[8]);
                 cameraOptions.SaveToPhotoAlbum = bool.Parse(args[9]);
+
+                // a very large number will force the other value to be the bound
+                if (cameraOptions.TargetWidth > -1 && cameraOptions.TargetHeight == -1)
+                {
+                    cameraOptions.TargetHeight = 100000;   
+                }
+                else if (cameraOptions.TargetHeight > -1 && cameraOptions.TargetWidth == -1)
+                {
+                    cameraOptions.TargetWidth = 100000;
+                }
             }
             catch (Exception ex)
             {