{ "id": "125221", "key": "TIMOB-16287", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-01-22T10:35:34.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "camera", "qe-3.2.1" ], "versions": [ { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:22.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Image taken in landscape orients itself to portrait. This occurs in SDK:3.2.0.GA & 3.1.3.GA as well, Hence not a regression\r\nSteps To Reproduce:\r\n1. Create app using below code.\r\n2. Run app\r\n3. In landscape orientation, click picture\r\n\r\nActual: Picture orients itself in portrait mode.\r\n\r\nExpected: Picture must remain in landscape mode until orientation is changed\r\n\r\n{code}\r\n\r\nvar _window = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nfunction fireUpTheCamera() {\r\n\t\t\t \t\tTitanium.Media.showCamera({\r\n\t\t\t \r\n\t\t\t \t\t success : function(event) {\r\n\t\t\t var cropRect = event.cropRect;\r\n\t\t\t var image = event.media;\r\n\t\t\t \r\n\t\t\t Ti.API.debug('Our type was: ' + event.mediaType);\r\n\t\t\t if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\t \r\n\t\t\t var imageView = Ti.UI.createImageView({\r\n\t\t\t width : _window.width,\r\n\t\t\t height : _window.height,\r\n\t\t\t image : event.media,\r\n\t\t\t autorotate: true\r\n\t\t\t });\r\n\t\t\t _window.add(imageView);\r\n\t\t\t } else {\r\n\t\t\t alert(\"got the wrong type back =\" + event.mediaType);\r\n\t\t\t }\r\n\t\t\t },\r\n\t\t\t cancel : function() {\r\n\t\t\t },\r\n\t\t\t error : function(error) {\r\n\t\t\t // create alert\r\n\t\t\t var a = Titanium.UI.createAlertDialog({\r\n\t\t\t title : 'Camera'\r\n\t\t\t });\r\n\t\t\t \r\n\t\t\t // set message\r\n\t\t\t if (error.code == Titanium.Media.NO_CAMERA) {\r\n\t\t\t a.setMessage('Please run this test on device');\r\n\t\t\t } else {\r\n\t\t\t a.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // show alert\r\n\t\t\t a.show();\r\n\t\t\t },\r\n\t\t\t saveToPhotoGallery : true,\r\n\t\t\t allowEditing : true,\r\n\t\t\t mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t\t\t });\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\t_window = Titanium.UI.createWindow({\r\n\t\t\t backgroundColor: 'blue'\r\n\t\t\t});\r\n\t\t\t_window.addEventListener('open', function(e) {\r\n\t\t\t fireUpTheCamera();\r\n\t\t\t});\r\n\t\t\t \r\n\t\t\t\r\n\t\t _window.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: image taken in landscape orients itself to portrait", "creator": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "OS: Mountain Lion 10.8\r\nAppcelerator Studio: 3.2.1.201401211804\r\nSDK: 3.2.1.v20140121132444\r\nXcode: 5.0\r\nacs:1.0.11\r\nalloy:1.3.1-beta2\r\njake:0.7.6\r\nnpm:1.3.2\r\nnode: 0.10.13\r\ntitanium:3.2.1\r\ntitanium-code-processor:1.1.0\r\nDevice: iPod touch 2 (v7.0.4)", "comment": { "comments": [ { "id": "289650", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Here are my findings: \r\n\r\n1. If you use the above sample code with the default Titanium app and follow the above steps, then the captured image will be portrait oriented on the blue window. This *is expected* since by default, only UIInterfaceOrientationPortrait is set under the UISupportedInterfaceOrientations~iphone in the tiapp.xml. \r\n\r\n2. If you include the other orientation property under UISupportedInterfaceOrientations~iphone (e.g. UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft, or UIInterfaceOrientationLandscapeRight), then the captured image (whether it was captured in portrait or landscape) will rotate along with the blue window; the captured image will still retain its orientation when you rotate the phone to portrait or landscape\r\n\r\n3. Another interesting finding is the UI controls during the image preview (after you take a picture with the above sample code, you can preview the image). If you use the above sample code to take a picture on an *iPhone device*, the UI controls during the image preview will *always* be portrait regardless of what properties are set in the tiapp.xml. However, on an *iPad device*, the UI controls will orient itself with the orientation of the physical device i.e. if the iPad is in landscape, the the UI controls in image preview will be landscape (also, regardless of what properties are set in the tiapp.xml). This indicates that we do not have full control of the native camera.\r\n\r\nTested on:\r\n\r\nAppcelerator Studio, build: 3.2.1.201401221450\r\nSDK build: 3.2.1.v20140122175749 \r\nCLI: 3.2.1-beta3\r\nAlloy: 1.3.1-beta3\r\nXcode: 5.0.2\r\nDevices: iphone 4s (7.0.4), ipad air (7.0.3)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-24T21:47:15.000+0000", "updated": "2014-01-24T21:48:08.000+0000" }, { "id": "290039", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pragya,\n\nWe can't control the Preview UI (retake or accept photo) and on iPhone this will rotate to portrait. On iPad the Preview UI is allowed to remain Landscape. \n\nRegarding the image view (blue background) we found that on iPhone with a default tiapp.xml, the UI would remain in portrait, but this was due to the available orientations set in the tiapp.xml. Adding the ability (via tiapp) to rotate the image view for iPhone would allow the UI to go landscape. In all cases the photo was shown in the correct orientation.\n\nPlease let me know if you have concerns about what I say.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-28T19:27:20.000+0000", "updated": "2014-01-28T19:27:20.000+0000" }, { "id": "290856", "author": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi Eric,\r\n\r\nAdding below code for ipod worked for me. Though, Preview UI was in portrait mode but that was not my concern. Earlier i assumed that adding orientation for iPhone will work for iPod as well.\r\n\r\n{code}\r\nUISupportedInterfaceOrientations~ipod\r\n \r\n UIInterfaceOrientationPortrait\r\n UIInterfaceOrientationPortraitUpsideDown\r\n UIInterfaceOrientationLandscapeLeft\r\n UIInterfaceOrientationLandscapeRight\r\n{code}\r\n\r\nThanks", "updateAuthor": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-02-03T09:38:43.000+0000", "updated": "2014-02-03T09:38:59.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }