{ "id": "83446", "key": "TIMOB-6493", "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": [ { "id": "12089", "description": "", "name": "Sprint 2011-49", "archived": true, "released": true, "releaseDate": "2011-12-12" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-09-15T16:13:31.000+0000", "created": "2011-12-06T16:45:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_media", "parity", "qe-3.4.0", "qe-testadded" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" } ], "issuelinks": [], "assignee": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-11-21T20:31:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. Expected Behavior:\r\nTake an horizontal screenShot and attach it to an email and the image attached goes horizontal too, or save the screenshot on the Photo Gallery and save it horizontal too.\r\n\r\nh4. Actual Behavior:\r\nThe image saves and attach to the email vertically, even if i create a matrix transformation and rotate this one, if i add to the window the image rotated looks good, but if i save to the photo gallery or attach it to an email, looks vertical again\r\n\r\nh4. Test Case:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:'#FFFFFF',\r\n orientationModes:[Ti.UI.PORTRAIT,Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT]\r\n});\r\n \r\nvar button = Ti.UI.createButton({\r\n title: 'ScreenShot!!'\r\n})\r\n \r\nbutton.addEventListener('click',function(){\r\n Titanium.Media.takeScreenshot(function(event){\r\n var screenShot = event.media;\r\n var img = Titanium.UI.createImageView({ \r\n image: screenShot,\r\n borderColor: 'red',\r\n borderWidth: 10\r\n });\r\n Ti.API.info('taking screenshot');\r\n img.addEventListener('click', function() {\r\n Ti.API.info('remove image');\r\n win.remove(img);\r\n img = null;\r\n });\r\n win.add(img);\r\n });\r\n});\r\n \r\nwin.add(button);\r\nwin.open();\r\n{code} ", "attachment": [ { "id": "50960", "filename": "ios_7.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-03T22:01:53.000+0000", "size": 53297, "mimeType": "image/png" }, { "id": "50961", "filename": "ios_8.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-03T22:01:53.000+0000", "size": 52084, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Titanium.Media.takeScreenshot fails to orient captured image to reflect hardware orientation", "creator": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "subtasks": [], "reporter": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "environment": "Titanium SDK version: 1.7.5 / 1.8.0.1\r\nPlatform OS: iOS\r\nPlatform OS Version: 5.0.1\r\nDevice Details: iPad2 Simulator, iPad2 Device\r\nHost Operating System: OSX 10.7.2\r\nTitanium Studio Build 1.0.6.201110251616", "closedSprints": [ { "id": 199, "state": "closed", "name": "2014 Sprint 18 SDK", "startDate": "2014-09-02T22:56:57.421Z", "endDate": "2014-09-13T00:00:00.000Z", "completeDate": "2014-09-15T20:08:19.146Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "175329", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Transforms don't appear to be applied to image views when converting to blobs. Looks like that's probably the issue here.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-07T18:54:18.000+0000", "updated": "2011-12-07T18:54:18.000+0000" }, { "id": "175616", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Aha. I get it now. It's because it's a screen shot. The UIScreen, of course, never rotates or is 'portrait' or 'landscape'. The rotation happens lower down, on the RootViewController. Thus, we have to manaually rotate the screenshot to meet expectations.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-09T15:33:33.000+0000", "updated": "2011-12-09T15:33:33.000+0000" }, { "id": "175638", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also, here's an updated test, now that screenshot taking does the right thing in terms of image orientation:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'#FFFFFF',\r\n\torientationModes:[Ti.UI.PORTRAIT,Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT]\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'ScreenShot!!'\r\n})\r\n\r\nbutton.addEventListener('click',function(){\r\n\tTitanium.Media.takeScreenshot(function(event){\r\n\t\tvar screenShot = event.media;\r\n\t\tvar img = Titanium.UI.createImageView({ image: screenShot });\r\n\t\tTi.API.info('saving the image into photogallery');\r\n\t\tTitanium.Media.saveToPhotoGallery(img.image);\r\n\t\tTi.API.info('saving the blob into photogallery');\r\n\t\tTitanium.Media.saveToPhotoGallery(img.toImage());\r\n\t\tTi.API.info('launch the email client!!');\r\n\t\tvar emailDialog = Titanium.UI.createEmailDialog()\r\n\t\temailDialog.subject = \"Colors of...\";\r\n\t\temailDialog.messageBody = 'Lorem ipsum...';\r\n\t\temailDialog.addAttachment(img.toImage());\r\n\t\temailDialog.open();\r\n\t\twin.add(img);\r\n\t});\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-09T16:57:15.000+0000", "updated": "2011-12-09T16:57:15.000+0000" }, { "id": "175671", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nOS: Mac OS X Lion\r\nSDK build: 1.8.0.1.v20111209204243\r\nTitanium Studio, build: 1.0.7.201112080131\r\nDevice: iphone 4S (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-12-10T11:19:26.000+0000", "updated": "2011-12-10T11:19:26.000+0000" }, { "id": "175678", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening issue to add qe-port label", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-12-10T11:58:10.000+0000", "updated": "2011-12-10T11:58:10.000+0000" }, { "id": "175680", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug after adding label.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-12-10T11:58:58.000+0000", "updated": "2011-12-10T11:58:58.000+0000" }, { "id": "178066", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Added label qe-testadded.", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T17:50:32.000+0000", "updated": "2012-01-04T17:50:32.000+0000" }, { "id": "321630", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening.\r\n\r\nThis issue is seen on IOS 8 beta 5 device. \r\nTested on IOS 7.1.2 device & works fine.\r\n\r\nEnvironment:\r\nAppc Studio : 3.4.0.201408291834\r\nTi SDK : 3.4.0.v20140829184521\r\nMac OSX : 10.9.4\r\nAlloy : 1.5.0-dev\r\nCLI - 3.4.0-dev\r\nCode Processor: 1.1.1\r\nxcode 6 beta 7\r\niphone 4S - IOS 8.0b5\r\nIpad mini - IOS 8.0b5", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-03T17:51:41.000+0000", "updated": "2014-09-03T17:51:41.000+0000" }, { "id": "321665", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Was able to reproduce the issue *only* on an iOS 8 device with Blain's code and the bug description's code (needed to fix it up first before trying it out). See ios_8.png attachment for the actual behavior and ios_7.png attachment for the expected behavior; in both attachment, the phone was oriented left (Titanium.UI.LANDSCAPE_LEFT).\r\n\r\n*Tested on:*\r\nAppcelerator Studio, build: 3.4.0.201409021758\r\nSDK: 3.4.0.v20140829184521 \r\nCLI: 3.4.0-dev\r\nAlloy: 1.5.0-dev\r\nXcode: 6-beta7\r\nDevices: ipad 4 (8.0-beta5), iphone 5 (8.0-beta5)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-03T22:01:40.000+0000", "updated": "2014-09-03T22:01:40.000+0000" }, { "id": "322374", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR master: https://github.com/appcelerator/titanium_mobile/pull/6029\r\nPR 3_4_X: https://github.com/appcelerator/titanium_mobile/pull/6030", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-08T21:38:35.000+0000", "updated": "2014-09-08T21:38:35.000+0000" }, { "id": "322869", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Ti.Media.takeScreenshot correctly orients the image to reflect hardware orientation.\r\n\r\nTested on:\r\n\r\nAppcelerator Studio, build: 3.4.0.201409081810\r\nSDK build: 3.4.0.v20140909222515 \r\nCLI: 3.4.0-rc\r\nAlloy: 1.5.0-rc\r\nXcode: 6 GM seed\r\nDevices: ipad 4 (8 GM Seed)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-10T18:22:20.000+0000", "updated": "2014-09-10T18:22:20.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }