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 2015/03/03 23:47:53 UTC

[1/2] cordova-plugin-camera git commit: add try ... catch for getting image orientation

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master bca73e6ee -> f39a08ba2


add try ... catch for getting image orientation

There's bug in Windows Phone 8.1 causing Seek on a DssPhotoStream not working properly.
https://connect.microsoft.com/VisualStudio/feedback/details/783252
But a mis-oriented file is better than nothing, so try and catch.

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/d7e708db
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/d7e708db
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/d7e708db

Branch: refs/heads/master
Commit: d7e708db092dee3140adbb906322de6f1ed6ec03
Parents: 80b0048
Author: VILIC VANE <i...@vilic.info>
Authored: Thu Jan 29 01:31:21 2015 +0800
Committer: VILIC VANE <i...@vilic.info>
Committed: Thu Jan 29 01:31:21 2015 +0800

----------------------------------------------------------------------
 src/wp/Camera.cs | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/d7e708db/src/wp/Camera.cs
----------------------------------------------------------------------
diff --git a/src/wp/Camera.cs b/src/wp/Camera.cs
index 30bb5e8..f4df7fc 100644
--- a/src/wp/Camera.cs
+++ b/src/wp/Camera.cs
@@ -271,21 +271,27 @@ namespace WPCordovaClassLib.Cordova.Commands
                             Picture pict = library.SavePicture(e.OriginalFileName, e.ChosenPhoto); // to save to photo-roll ...
                         }
 
-                        int orient = ImageExifHelper.getImageOrientationFromStream(e.ChosenPhoto);
                         int newAngle = 0;
-                        switch (orient)
-                        {
-                            case ImageExifOrientation.LandscapeLeft:
-                                newAngle = 90;
-                                break;
-                            case ImageExifOrientation.PortraitUpsideDown:
-                                newAngle = 180;
-                                break;
-                            case ImageExifOrientation.LandscapeRight:
-                                newAngle = 270;
-                                break;
-                            case ImageExifOrientation.Portrait:
-                            default: break; // 0 default already set
+                        // There's bug in Windows Phone 8.1 causing Seek on a DssPhotoStream not working properly.
+                        // https://connect.microsoft.com/VisualStudio/feedback/details/783252
+                        // But a mis-oriented file is better than nothing, so try and catch.
+                        try {
+                            int orient = ImageExifHelper.getImageOrientationFromStream(e.ChosenPhoto);
+                            switch (orient) {
+                                case ImageExifOrientation.LandscapeLeft:
+                                    newAngle = 90;
+                                    break;
+                                case ImageExifOrientation.PortraitUpsideDown:
+                                    newAngle = 180;
+                                    break;
+                                case ImageExifOrientation.LandscapeRight:
+                                    newAngle = 270;
+                                    break;
+                                case ImageExifOrientation.Portrait:
+                                default: break; // 0 default already set
+                            }
+                        } catch {
+                            Debug.WriteLine("Error fetching orientation from Exif");
                         }
 
                         if (newAngle != 0)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/2] cordova-plugin-camera git commit: Merge branch 'patch-1' of https://github.com/vilic/cordova-plugin-camera

Posted by pu...@apache.org.
Merge branch 'patch-1' of https://github.com/vilic/cordova-plugin-camera


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/f39a08ba
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/f39a08ba
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/f39a08ba

Branch: refs/heads/master
Commit: f39a08ba29950555608051450e487402dec78ef1
Parents: bca73e6 d7e708d
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 3 14:43:07 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 3 14:43:07 2015 -0800

----------------------------------------------------------------------
 src/wp/Camera.cs | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org