{ "id": "87162", "key": "TIMOB-7848", "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": "15707", "description": "2013 Sprint 23", "name": "2013 Sprint 23", "archived": true, "released": true, "releaseDate": "2013-11-15" }, { "id": "15708", "description": "2013 Sprint 23 API", "name": "2013 Sprint 23 API", "archived": true, "released": true, "releaseDate": "2013-11-15" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-10-29T21:08:02.000+0000", "created": "2012-02-29T10:36:13.000+0000", "epic": { "id": 105183, "key": "TIMOB-11818", "name": "Android: Camera Bugs", "summary": "Android: Address deficiencies in the Camera implementation", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "23665", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "99639", "key": "TIMOB-10567", "fields": { "summary": "Ti API: Expose EXIF data of an image through Titanium API", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T21:38:23.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": "The attached app.js file reproduces the issue. Here are the steps:\r\n\r\n1. Start the app and take a picture and save it.\r\n2. It is saved to an imageview. Click on the imageview to rotate the image.\r\n3. Now, you will get an alert showing the location of the rotated image. I have it saved on the sdcard.\r\n4. View the sdcard to see the image (you will need a file manager to view it). \r\n5. The image is saved as the originally taken and not the rotated.\r\n\r\nHere is the sample file:\r\n\r\n{noformat}\r\n\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor:'white'\r\n});\r\n\r\nTitanium.Media.showCamera({\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 Ti.API.debug('Our type was: '+event.mediaType);\r\n if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)\r\n {\r\n /******** capture image in a imageView ********/\r\n \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 \r\n /******** rotate the imageView ************/\r\n \r\n var transformCurrentPicture = Titanium.UI.create2DMatrix();\r\n imageView.addEventListener('click',function(e){\r\n transformCurrentPicture = transformCurrentPicture.rotate(90);\r\n imageView.animate({transform:transformCurrentPicture});\r\n savePhoto('Hello.png',imageView.toBlob()); \r\n });\r\n \r\n \r\n \r\n // savePhoto('Hello',imageView.toBlob()); \r\n }\r\n else\r\n {\r\n alert(\"got the wrong type back =\"+event.mediaType);\r\n }\r\n },\r\n cancel:function()\r\n {\r\n },\r\n error:function(error)\r\n {\r\n // create alert\r\n var a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n\r\n // set message\r\n if (error.code == Titanium.Media.NO_CAMERA)\r\n {\r\n a.setMessage('Please run this test on device');\r\n }\r\n else\r\n {\r\n a.setMessage('Unexpected error: ' + error.code);\r\n }\r\n\r\n // show alert\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/******* function to save the image **********/\r\n\r\nfunction savePhoto(photoName,photoToSave){\r\n var photoPath = '';\r\n var photoDir = ''; \r\n \r\n //Check for photo dir and create if not there \r\n \r\n if (Titanium.Filesystem.isExternalStoragePresent()){ \r\n photoDir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory, 'PlayGroundPhotos');\r\n if ( ! photoDir.exists()){\r\n photoDir.createDirectory(); \r\n }\r\n }\r\n \r\n //check for photo dir and create if not there locally since no external storage\r\n \r\n else{ \r\n photoDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'PlayGroundPhotos');\r\n if ( ! photoDir.exists()) {\r\n photoDir.createDirectory(); \r\n }\r\n else{\r\n alert('photoDir exists');\r\n }\r\n } \r\n \r\n //At this point we know if SD card exists and have created photo directory if needed\r\n \r\n photoPath = photoDir.nativePath;\r\n alert('The photopath is: '+photoPath);\r\n var f = Titanium.Filesystem.getFile(photoPath,photoName); \r\n f.write(photoToSave); \r\n} \r\n\r\n\r\n\r\n{noformat}", "attachment": [ { "id": "36487", "filename": "1.png", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T09:47:44.000+0000", "size": 509265, "mimeType": "image/png" }, { "id": "36488", "filename": "2.png", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T09:47:44.000+0000", "size": 285136, "mimeType": "image/png" }, { "id": "36489", "filename": "3.png", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T09:47:44.000+0000", "size": 146186, "mimeType": "image/png" }, { "id": "36490", "filename": "4.jpg", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T09:47:44.000+0000", "size": 2817928, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "Android: Cannot save rotated camera images", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Product: Mobile\r\nTitanium SDK: Mobile 1.9.x, 1.8.x\r\nPlatform OS: Android\r\nPlatform OS Version: 2.2\r\nDevices Tested On: HTC Sensation 4G, LGVM670\r\n", "comment": { "comments": [ { "id": "243126", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It seems to be a bug, Here i attached my observation .\r\n\r\n1.After taking photo \r\n2.After click save, it shows 90 degree rotated imageview\r\n3.when clicking on imageview it rotate to original state\r\n4.photo in sdcard ", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T09:28:32.000+0000", "updated": "2013-03-20T10:51:21.000+0000" }, { "id": "277258", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not a valid test case. The method {code}imageView.animate({transform:transformCurrentPicture});{code} only applies a rotation matrix to the canvas to render the imageview but not changes/rotates the image itself. Therefore the saved file is always the original image. Resolved the ticket as Invalid.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-29T21:06:57.000+0000", "updated": "2013-10-29T21:06:57.000+0000" }, { "id": "415419", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T21:38:23.000+0000", "updated": "2017-03-23T21:38:23.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }