{ "id": "83169", "key": "TIMOB-6351", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-09-13T20:05:22.000+0000", "created": "2011-11-29T09:59:57.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "17849", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "93337", "key": "TIMOB-9580", "fields": { "summary": "Android: Images captured using Ti.Media.showCamera() are written to SD card on Android", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-27T02:36:42.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Problem\r\n\r\nSaveToPhotoGallery:false does not work in android.\r\n\r\nh3. Reproducible steps:\r\n \r\n1. Run the code below\r\n\r\nh3. Expected behavior:\r\n\r\nCustomer does not want to save the image to the gallery after taking a picture.\r\n\r\nh3. More info:\r\n\r\nIn iOS works well.\r\nhttp://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Media.showCamera-method.html\r\nsaveToPhotoGalleryboolean if the media should be saved to the photo gallery upon successful capture.\r\n\r\nh3. Tested with the next specs:\r\nSamsung Galaxy Fit-Android Version : 2.2.1\r\niPhone 3G Version: 4.3.5\r\nSimulator\r\nTitanium Studio, build: 1.0.7.201111231202\r\nTitanium SDK: 1.8.0.v20111114103905\r\nGoogle APIs Android 2.3.3\r\n\r\nh3. Sample code:\r\n{code}\r\nvar mwin = Ti.UI.createWindow({\r\n\tbackgroundColor : 'orange'\r\n});\r\n\r\nvar btnShowCamera = Ti.UI.createButton({\r\n\ttitle : 'Take picture',\r\n\twidth : 150,\r\n\theight : 70,\r\n\ttop : 50\r\n});\r\n\r\nmwin.add(btnShowCamera);\r\n\r\nbtnShowCamera.addEventListener('click', function(e) \r\n{\r\n\tvar win = Titanium.UI.currentWindow;\r\n\tTitanium.Media.showCamera(\r\n\t{\r\n\t\tmediaTypes : Titanium.Media.MEDIA_TYPE_PHOTO,\r\n\t\tallowEditing : true,\r\n\t\tsaveToPhotoGallery:true,\r\n\r\n\t\tsuccess : function(event) \r\n\t\t{\r\n\t\t\tvar cropRect = event.cropRect;\r\n\t\t\tvar image = event.media;\r\n\t\t\t\r\n\t\t\tvar imageView = Titanium.UI.createImageView(\r\n\t\t\t{\r\n\t\t\t\timage : image,\r\n\t\t\t\twidth : 480,\r\n\t\t\t\theight : 640\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\timage = imageView.toBlob();\r\n\t\t\tvar photoPath = '';\r\n\t\t\tvar photoDir = '';\r\n\r\n\t\t\tif(Titanium.Filesystem.isExternalStoragePresent()) \r\n\t\t\t{\r\n\t\t\t\tphotoDir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory, 'PlayGroundPhotos');\r\n\t\t\t\tif(!photoDir.exists()) \r\n\t\t\t\t{\r\n\t\t\t\t\tphotoDir.createDirectory();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tphotoPath = photoDir.nativePath;\r\n\t\t\tvar f = Titanium.Filesystem.getFile(photoPath, 'tony.jpg');\r\n\t\t\tf.write(image);\r\n\t\t},\r\n\t\r\n\t\tcancel : function() \r\n\t\t{\r\n\t\t},\r\n\t});\r\n});\r\nmwin.open();\r\n\r\n{code}\r\n \r\nh3. Helpdesk\r\nAPP-344567 ", "attachment": [], "flagged": false, "summary": " Android: saveToPhotoGallery:false does not work in android.", "creator": { "name": "framirez", "key": "framirez", "displayName": "Francisco Antonio Duran Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "framirez", "key": "framirez", "displayName": "Francisco Antonio Duran Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Samsung Galaxy Fit-Android Version : 2.2.1\r\niPhone 3G Version: 4.3.5\r\nSimulator\r\nTitanium Studio, build: 1.0.7.201111231202\r\nTitanium SDK: 1.8.0.v20111114103905\r\nGoogle APIs Android 2.3.3", "comment": { "comments": [ { "id": "189313", "author": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I also reproduced the similar behavior: when saveToPhotoGallery=false, picture is saved in Camera folder, as well as folder named \r\n\r\nsample code:\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\n\r\n\r\nTitanium.Media.showCamera({\r\n success:function(event) {\r\n // called when media returned from the camera\r\n Ti.API.debug('Our type was: '+event.mediaType);\r\n if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n var imageView = Ti.UI.createImageView({\r\n width:win.width,\r\n height:win.height,\r\n image:event.media\r\n });\r\n win.add(imageView);\r\n } else {\r\n alert(\"got the wrong type back =\"+event.mediaType);\r\n }\r\n },\r\n cancel:function() {\r\n // called when user cancels taking a picture\r\n },\r\n error:function(error) {\r\n // called when there's an error\r\n var a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n if (error.code == Titanium.Media.NO_CAMERA) {\r\n a.setMessage('Please run this test on device');\r\n } else {\r\n a.setMessage('Unexpected error: ' + error.code);\r\n }\r\n a.show();\r\n },\r\n saveToPhotoGallery:false,\r\n allowEditing:true,\r\n mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\r\n});\r\n\r\nwin.open();\r\n\r\n{code}", "updateAuthor": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-30T12:29:02.000+0000", "updated": "2012-03-30T12:29:02.000+0000" }, { "id": "199729", "author": { "name": "vinothbabu", "key": "vinothbabu", "displayName": "Vinothbabu", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any update on this issue, we are facing it in 2.0.2 as well. When placing saveToPhotoGallery:false, it does get saved in the DCIM/Camera/My_APP", "updateAuthor": { "name": "vinothbabu", "key": "vinothbabu", "displayName": "Vinothbabu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-22T07:42:39.000+0000", "updated": "2012-06-22T07:42:39.000+0000" }, { "id": "199772", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Vinothbabu - We are not able to reproduce this issue with the latest master build (2.1.0). Please try your application with the latest build and see if it resolves the issue.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-22T11:40:13.000+0000", "updated": "2012-06-22T11:40:13.000+0000" }, { "id": "216402", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue is still occurring, I was able to reproduce using 2.1.1GA and the latest master build (2.2.0).", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T04:35:34.000+0000", "updated": "2012-08-28T04:35:34.000+0000" }, { "id": "217015", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "What is the criteria being used to determine if a picture gets saved to the gallery here?\r\nI wouldn't expect that criteria to be whether the photo shows up in the Android Gallery\r\napp -- that app can find photos anywhere in phone storage in Android 4.0.\r\n\r\nThe Appcelerator docs says this about saveToPhotoGallery:\r\n\r\n saveToPhotoGallery : Boolean\r\n Specifies if the media should be saved to the photo gallery upon successful capture.\r\n\r\n Defaults to: False\r\n\r\nI tried the code above, these are the results on Samsung Galaxy S3 (Sprint)\r\nrunning Android 4.0:\r\n\r\n(1) saveToPhotoGallery=true\r\n\r\n Image is saved to /mnt/sdcard/Pictures//.jpg\r\n\r\n This is the standard Android location to store pictures, with a sub-folder\r\n named for the app.\r\n\r\n(2) saveToPhotoGallery=false\r\n\r\n Image is saved to /mnt/extSdCard/DCIM/Camera/.jpg\r\n\r\n This is the location on my phone where I have configured the Android Camera\r\n app to store images (note that I've configured the camera app to put images\r\n on the SD card with is /mnt/extSdCard in this case).\r\n\r\n", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-30T11:11:00.000+0000", "updated": "2012-08-30T11:11:00.000+0000" }, { "id": "217064", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think the customer is asking to not save an extra copy of a photo --\r\nit doesn't look like the saveToPhotoGallery option was intended to do\r\nthat.\r\n\r\nI talked to Josh, and he pointed out that some camera apps from\r\nvarious manufacturers don't give the user an option not to do\r\nthis.\r\n\r\nAn alternative is to use an overlay as described here to avoid\r\nusing the in-device camera app:\r\n\r\nhttp://docs.appcelerator.com/titanium/2.1/index.html#!/api/CameraOptionsType\r\n\r\n", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-30T14:53:51.000+0000", "updated": "2012-08-30T14:53:51.000+0000" }, { "id": "218951", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving this ticket in the correct status as we were not able to reproduce the issue reported in this ticket.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-13T20:05:22.000+0000", "updated": "2012-09-13T20:05:22.000+0000" }, { "id": "270959", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "This is still happening on Ti SDK 3.1.2.GA\r\n\r\nTested on several devices (Android 4.0, 4.1, 4.2 and 4.3)\r\n\r\nDevices: Nexus 7 (2013), Samsung Galaxy S2, Samsung Galaxy S3, Samsung Galaxy S4, LG L5, Motorola Razr\r\n\r\nPhoneGap solved this as per: http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html\r\n", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-09-12T21:50:36.000+0000", "updated": "2013-09-12T21:50:36.000+0000" }, { "id": "273112", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "any news on this one?", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-09-27T02:36:42.000+0000", "updated": "2013-09-27T02:36:42.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }