{ "id": "111827", "key": "TIMOB-13240", "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": "15397", "description": "2013 Soprint 07 API", "name": "2013 Sprint 07 API", "archived": true, "released": true, "releaseDate": "2013-04-08" }, { "id": "15105", "description": "2013 Sprint 07", "name": "2013 Sprint 07", "archived": true, "released": true, "releaseDate": "2013-04-08" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-04-01T23:16:45.000+0000", "created": "2013-03-28T11:39:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-3.1.0" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-03-31T10:38:49.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": "Titanium.Media.openPhotoGallery is not working for iPads. \r\nThis is not regression since the issue occurs on 3.0.2 GA as well\r\n\r\nSteps to reproduce:\r\n1. Create an app using the code below.\r\n2. Launch the test app.\r\n\r\nActual:\r\nNo photo gallery is invoked on iPads whereas photo gallery is successfully invoked on iPhones.\r\n\r\nExpected:\r\nPhoto gallery should be invoked on iPads as well.\r\n\r\n{code} \r\n\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'white'\r\n});\r\n\r\n \r\nvar imageView = Titanium.UI.createImageView({\r\n height:200,\r\n width:200,\r\n top:20,\r\n left:10,\r\n backgroundColor:'#999'\r\n});\r\n \r\nvar popoverView;\r\nvar arrowDirection;\r\n \r\nif (Titanium.Platform.osname == 'ipad')\r\n{\r\n // photogallery displays in a popover on the ipad and we\r\n // want to make it relative to our image with a left arrow\r\n arrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT;\r\n popoverView = imageView;\r\n}\r\n \r\nTitanium.Media.openPhotoGallery({\r\n \r\n success:function(event)\r\n {\r\n var cropRect = event.cropRect;\r\n var image = event.media;\r\n \r\n // set image view\r\n Ti.API.debug('Our type was: '+event.mediaType);\r\n if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)\r\n {\r\n imageView.image = image;\r\n }\r\n else\r\n {\r\n // is this necessary?\r\n }\r\n \r\n Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);\r\n \r\n },\r\n cancel:function()\r\n {\r\n alert('cancelled fired');\r\n },\r\n error:function(error)\r\n {\r\n },\r\n allowEditing:true,\r\n popoverView:popoverView,\r\n arrowDirection:arrowDirection,\r\n mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\r\n \r\n});\r\n\r\nwin1.add(imageView);\r\n\r\nwin1.open();\r\n\t\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Media - Titanium.Media.openPhotoGallery is not working for iPads", "creator": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested with:\r\nSDK: 3.1.0.v20130327135307\r\nStudio:3.0.2.201302191606\r\nDevice: iPad mini(v 6.0), iPad2(v 5.1), iPhone5(v 6.0)", "comment": { "comments": [ { "id": "245064", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case is invalid.\nuse this code \n{code}\nvar win = Titanium.UI.createWindow({ \n title:'Tab 1',\n backgroundColor:'white'\n});\nvar imageView = Titanium.UI.createImageView({\n\theight:200,\n\twidth:200,\n\ttop:20,\n\tleft:10,\n\tbackgroundColor:'#999'\n});\n\nwin.add(imageView);\n\nvar popoverView;\nvar arrowDirection;\n\nif (Titanium.Platform.osname == 'ipad')\n{\n\t// photogallery displays in a popover on the ipad and we\n\t// want to make it relative to our image with a left arrow\n\tarrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT;\n\tpopoverView = imageView;\n}\n\nimageView.addEventListener('click', function(){\n\nTitanium.Media.openPhotoGallery({\n\n\tsuccess:function(event)\n\t{\n\t\tvar cropRect = event.cropRect;\n\t\tvar image = event.media;\n\n\t\t// set image view\n\t\tTi.API.debug('Our type was: '+event.mediaType);\n\t\tif(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)\n\t\t{\n\t\t\timageView.image = image;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// is this necessary?\n\t\t}\n\n\t\tTitanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);\n\n\t},\n\tcancel:function()\n\t{\n\n\t},\n\terror:function(error)\n\t{\n\t},\n\tallowEditing:true,\n\tpopoverView:popoverView,\n\tarrowDirection:arrowDirection,\n\tmediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\n});\n\n\n\n\n});\n\nwin.open();\n{code}\n\nNow click on the imageView. popup should appear.\n\nMarking ticket as invalid.", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-01T23:16:28.000+0000", "updated": "2013-04-01T23:16:28.000+0000" }, { "id": "246837", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\r\nSDK: 3.1.0.v20130409124549\r\nStudio:3.1.0.201304011603\r\nDevice: iPad2(v 5.1)\r\nOS: OSX 10.7.5\r\n\r\nChanged test case works well for iPads as well.", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-10T09:02:18.000+0000", "updated": "2013-04-10T09:02:18.000+0000" }, { "id": "347919", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "function OpenPhoneGallery(){\r\n\tthis.animate(VARS.a); \r\n\t\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess : function(ev) {\r\n\t\t\tSharePageCallFunc(ev);\r\n\t\t},\r\n\t\tcancel : function(){\r\n\t\t\talert(\"Gallery closed\");\r\n\t\t},\r\n\t\terror : function(err){\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\ttitle : 'Gallery'\r\n\t\t\t});\t\t\t\r\n\t\t\ta.setMessage('Unexpected error: ' + err.code);\t\t\r\n\t\t\ta.show();\r\n\t\t}, \r\n\t\t\tshowControls : false, \r\n\t\t\tmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\n\t\t\tautohide : true \r\n\t});\r\n}\r\n", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-03-31T10:21:32.000+0000", "updated": "2015-03-31T10:21:32.000+0000" }, { "id": "347920", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "function OpenPhoneGallery(){\r\n\tthis.animate(VARS.a); \r\n\t\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess : function(ev) {\r\n\t\t\tSharePageCallFunc(ev);\r\n\t\t},\r\n\t\tcancel : function(){\r\n\t\t\talert(\"Gallery closed\");\r\n\t\t},\r\n\t\terror : function(err){\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\ttitle : 'Gallery'\r\n\t\t\t});\t\t\t\r\n\t\t\ta.setMessage('Unexpected error: ' + err.code);\t\t\r\n\t\t\ta.show();\r\n\t\t}, \r\n\t\t\tshowControls : false, \r\n\t\t\tmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\n\t\t\tautohide : true \r\n\t});\r\n}\r\n", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-03-31T10:21:32.000+0000", "updated": "2015-03-31T10:21:32.000+0000" }, { "id": "347921", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-03-31T10:38:49.000+0000", "updated": "2015-03-31T10:38:49.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }