{ "id": "83177", "key": "TIMOB-6357", "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": "2013-03-27T17:57:01.000+0000", "created": "2011-11-29T13:19:09.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "exalture" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-21T21:32:45.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\nAfter taking a picture in android with the code below the application creates 2 files in the next path:\r\n/sdcard/DCIM/camera/\r\nOne of them is named with the initials tiaxxx.jpg\r\n\r\nh3. Reproducible steps:\r\n \r\n1. Run the code below\r\n2. Take a picture\r\n3. Go to the next path: /sdcard/DCIM/camera/\r\n\r\nNotice that in the above path is created a file with the name of tiaxxx.jpg\r\n\r\nh3. Expected behavior:\r\n\r\nCustomer does not want to have another image stored with the name Tiaxxxx.jpg in the next path: /sdcard/DCIM/camera/\r\n\r\nh3. More info:\r\nI use saveToPhotoGallery:false too, but it's the same expected behavior.\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\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\t//var 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\t\r\n\r\n\t\t\tif(Titanium.Filesystem.isExternalStoragePresent()) \r\n\t\t\t{\r\n\t\t\t\tvar photoDir = 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\tvar photoPath = 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 \r\n", "attachment": [], "flagged": false, "summary": "Android: Duplicating file with another name on android after saving a picture", "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\nLG Ally-Android Version : 2.2\r\nTitanium Studio, build: 1.0.7.201111231202\r\nTitanium SDK: 1.8.0.1.v20111121090256 & 1.8.0.v20111114103905\r\n", "comment": { "comments": [ { "id": "189314", "author": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Similar behavior observed. Duplicate images with different file names are stored in gallery.\r\n\r\ncode:\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:true,\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:34:02.000+0000", "updated": "2012-03-30T12:34:02.000+0000" }, { "id": "244330", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Setting saveToPhotoGallery to true will automatically save the image in device photo gallary. If I set this to false, I don't see the extra file getting created.\r\n\r\nTested with SDK 3.1.0 using Google Nexus.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-03-27T17:57:01.000+0000", "updated": "2013-03-27T17:57:01.000+0000" }, { "id": "414464", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:32:45.000+0000", "updated": "2017-03-21T21:32:45.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }