You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/05/17 03:26:14 UTC

ios commit: Fixes CB-760 - Camera returns incorrect image size

Updated Branches:
  refs/heads/master 787171505 -> 9d7ed2e2e


Fixes CB-760 - Camera returns incorrect image size


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/9d7ed2e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/9d7ed2e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/9d7ed2e2

Branch: refs/heads/master
Commit: 9d7ed2e2eaca9bf5b81bfe834625cbb9d837213e
Parents: 7871715
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed May 16 18:26:00 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed May 16 18:26:00 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCamera.m |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9d7ed2e2/CordovaLib/Classes/CDVCamera.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCamera.m b/CordovaLib/Classes/CDVCamera.m
index 5dc077d..fd8fe1a 100644
--- a/CordovaLib/Classes/CDVCamera.m
+++ b/CordovaLib/Classes/CDVCamera.m
@@ -435,7 +435,7 @@
         } else {
             scaleFactor = widthFactor; // scale to fit width
         }
-        scaledSize = CGSizeMake(width * scaleFactor, height * scaleFactor);
+        scaledSize = CGSizeMake(MIN(width * scaleFactor, targetWidth), MIN(height * scaleFactor, targetHeight));
     }
     
     UIGraphicsBeginImageContext(scaledSize); // this will resize