{ "id": "87687", "key": "AC-2769", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "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-04-10T22:27:20.000+0000", "created": "2012-03-11T03:45:48.000+0000", "labels": [ "image", "imageview" ], "versions": [], "issuelinks": [], "assignee": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:47:40.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I was trying to let the user select an image from the gallery then show it in an imageview befor sending it over to my server.\r\nthe window that contains the imageview has a back button(confirmationWindow.close()) to cancel and start over.\r\nthe first time is no problem the image loads perfectly but then it starts to get buggy and sometimes the image isn't visible.\r\n\r\nis this a bug? or am I doing something wrong?\r\n{code:java}\r\nTitanium.Media.openPhotoGallery({\r\n success: processImage,\r\n cancel: function(){return false;},\r\n error: imageFailed,\r\n });\r\n \r\nfunction processImage(image){\r\n //remove previously added image\r\n var children = imageHolder.children.slice(0);\r\n for (var i = 0; i < children.length; ++i) {\r\n imageHolder.remove(children[i]);\r\n }\r\n // place our picture into our window\r\n imageHolder.add(Ti.UI.createImageView({\r\n transform: Ti.UI.create2DMatrix().scale(1),\r\n center: {x: '50%', y: '50%'},\r\n image: image.media,\r\n }));\r\n imageviewer.open();\r\n //imageHolder.add(webview);\r\n Titanium.App.imageBlob = image.media;\r\n /*\r\n * rotate image\r\n */\r\n var cropRect = image.cropRect; \r\n var height = cropRect.height;\r\n var width = cropRect.width;\r\n alert(\"base64=\" + image.media.toString());\r\n if(height> width){\r\n //imageView.transform = Titanium.UI.create2DMatrix({rotate: -90,duration: 1,}); \r\n }\r\n return false;\r\n \r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "sequential use of openPhotoGallery with imageview.", "creator": { "name": "mars", "key": "mars", "displayName": "marzpet vardanyan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mars", "key": "mars", "displayName": "marzpet vardanyan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "windows\r\ntitanium sdk 2.0\r\nandroid", "comment": { "comments": [ { "id": "189426", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Marzpet - \r\n\r\nI've not been able to reproduce the issue starting from your sample code. This is how I adapted your sample code:http://pastie.org/3712949\r\n\r\nIt would be possible for you to post a whole runnable portion of code reproducing your problem? I'm missing a few objects (imageviewer for example).\r\n\r\nThanks\r\n", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-01T22:21:55.000+0000", "updated": "2012-04-01T22:21:55.000+0000" }, { "id": "190344", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Hey Marzpet,\r\n\r\nI don't seem to be able to reproduce this issue with your given code either. Any chance you could attach a working sample project that reproduces the problem? This will help us fix this bug asap. Thank you!\r\n\r\nJunaid", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-04-09T11:15:44.000+0000", "updated": "2012-04-09T11:15:44.000+0000" }, { "id": "198110", "author": { "name": "edgardz", "key": "edgardz", "displayName": "Edgard Zavarezzi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm also having similar issues. When calling openPhotoGallery and selecting a picture, it works only two times, then freeze on the Move and Scale view.\r\n\r\nCode:\r\n\r\n\r\nvar pictureDialog = Ti.UI.createOptionDialog({\r\n\tcancel: 2,\r\n\toptions: ['Gallery', 'Camera', 'Cancel'],\r\n\ttitle: 'Select'\r\n});\r\n\r\npictureMoldura.addEventListener('click', function(e)\r\n{\r\n\tpictureDialog.show();\r\n\t\r\n\tpictureDialog.addEventListener('click', function(e)\r\n\t{\r\n\t\tswitch(e.index)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\tTitanium.Media.openPhotoGallery(\r\n\t\t\t\t{\r\n\t\t\t\t\tsuccess:function(event)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror:function(error)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tTi.API.debug(error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tallowEditing:true,\r\n\t\t\t\t\tmediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t...", "updateAuthor": { "name": "edgardz", "key": "edgardz", "displayName": "Edgard Zavarezzi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-11T17:45:59.000+0000", "updated": "2012-06-11T17:45:59.000+0000" }, { "id": "198166", "author": { "name": "edgardz", "key": "edgardz", "displayName": "Edgard Zavarezzi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It looks like the error is occurring when using an OptionDialog to call the photoGallery.\r\nRecreating the optionDialog every time seems to solve the problem:\r\n\r\nbutton.addEventListener('click', editPicture);\r\n\r\nfunction editPicture(e)\r\n{\r\n\tvar pictureDialog \t= null;\r\n\t\r\n\tvar pictureDialog = Ti.UI.createOptionDialog({\r\n\t\tcancel: 2,\r\n\t\toptions: ['Gallery', 'Camera', 'Calcel'],\r\n\t\ttitle: 'Select'\r\n\t});\r\n\r\npictureDialog.addEventListener('click', function(e)\r\n\t{\r\n\t\tswitch(e.index)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\tTitanium.Media.openPhotoGallery( ...\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t\tTitanium.Media.showCamera( ...\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n});\r\n\r\npictureDialog.show();\r\n}", "updateAuthor": { "name": "edgardz", "key": "edgardz", "displayName": "Edgard Zavarezzi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-12T10:32:58.000+0000", "updated": "2012-06-12T10:32:58.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }