{ "id": "118406", "key": "TIMOB-14852", "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": "15695", "description": "2013 Sprint 20", "name": "2013 Sprint 20", "archived": true, "released": true, "releaseDate": "2013-10-04" }, { "id": "15696", "description": "2013 Sprint 20 API", "name": "2013 Sprint 20 API", "archived": true, "released": true, "releaseDate": "2013-10-04" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-10-04T18:04:55.000+0000", "created": "2013-08-13T13:56:01.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": "High", "id": "2" }, "labels": [ "android", "camera", "mobilesdk", "titanium" ], "versions": [ { "id": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [ { "id": "32059", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "117137", "key": "TIMOB-14540", "fields": { "summary": "Android: blob.imageAsResize causes java error", "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": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-22T22:54:15.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": "Trying to render images on imageView captured using Camera API, But imageView done not render images after 2 or 3 if images are not resized using imageAsResized method.\r\n\r\nSteps to reproduce:\r\n\r\n1: Use the attached app.js or below sample code.\r\n2: Run it using new sample project.\r\n3: Test the application on device (Preferred is Samsung S3 or S2 with android 4.1.2).\r\n4: If images are not resized then after 2 or 3 images, image view won't display them.\r\n\r\n**sample code**\r\n{code}\r\nvar mainWin = Ti.UI.createWindow({\r\n\tbackgroundColor:\"#fff\"\r\n});\r\nvar button = Ti.UI.createButton({\r\n\ttitle : \"Take\",\r\n\twidth : \"60dp\",\r\n\theight : \"45dp\",\r\n\ttop : \"2dp\",\r\n\tleft : \"2dp\"\r\n});\r\n\r\nvar button1 = Ti.UI.createButton({\r\n\ttitle : \"Add\",\r\n\twidth : \"60dp\",\r\n\theight : \"45dp\",\r\n\ttop : \"2dp\",\r\n\tright : \"2dp\"\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\tlayout:\"horizontal\",\r\n\ttop:\"50dp\"\r\n})\r\n\r\nvar successCallBack = function(e) {\r\n\t\tif (e.mediaType != Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\tTi.App.fireEvent('hide_indicator');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvar image = e.media;//.imageAsResized(120,120); //400 - 17 images added and if only e.media 2 images..\r\n\t\tvar filename = (new Date().getTime()) + \".jpg\";\r\n\t\tTi.API.info(\"JAVA : \"+ filename + \" \" + e.media.getLength());\r\n\t\t\r\n\t\tvar newImageView = Ti.UI.createImageView({\r\n\t\t\timage : image,\r\n\t\t\twidth : \"60dp\",\r\n\t\t\theight : \"60dp\",\r\n\t\t\tleft : \"5dp\",\r\n\t\t\ttop: \"5dp\"\r\n\t\t});\r\n\t\tscrollView.add(newImageView);\r\n\t\tvar bgImage = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, filename);\r\n\t\tbgImage.write(image);\r\n\t\t//utils.resizeKeepAspectRatioNewWidth(bgImage.getNativePath(), image.width, image.height, Config.imageMaxWidth);\r\n\t};\r\n\r\n\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tTi.Media.showCamera({\r\n\t\tsuccess : successCallBack,\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n});\r\n\r\nbutton1.addEventListener(\"click\", function(e) {\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess : successCallBack,\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n});\r\n\r\nmainWin.add(scrollView);\r\nmainWin.add(button);\r\nmainWin.add(button1);\r\nmainWin.open();\r\n\r\n{code}", "attachment": [ { "id": "41567", "filename": "app.js", "author": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-13T13:56:02.000+0000", "size": 1565, "mimeType": "text/javascript" } ], "flagged": false, "summary": "Android: Image View does not render all the images captured using device Camera", "creator": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Titanium Mobile SDK, Android.", "comment": { "comments": [ { "id": "266380", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi,\r\nEven if I use *e.media.imageAsResized* also facing issue. Getting run time issue (Java error). I tried with different modules but no use.\r\nThank you. ", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-14T05:15:00.000+0000", "updated": "2013-08-14T05:15:00.000+0000" }, { "id": "268559", "author": { "name": "josh.magalich@crompco.com", "key": "josh.magalich@crompco.com", "displayName": "Josh Magalich", "active": true, "timeZone": "America/New_York" }, "body": "I get the same error after I add 3 or 4 image thumbnails (from the photo gallery) to a view. Is there any work around for this issue? I see the due date got bumped further. Thank you.", "updateAuthor": { "name": "josh.magalich@crompco.com", "key": "josh.magalich@crompco.com", "displayName": "Josh Magalich", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-28T13:27:58.000+0000", "updated": "2013-08-28T13:27:58.000+0000" }, { "id": "268562", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi [~josh.magalich@crompco.com],\r\nI got few suggestion for this issue from Appc saying save the file first and then try to resize or thumbnail from file blob. Even in that case also I am getting java runtime error.\r\n\r\nThank you.", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-28T13:39:33.000+0000", "updated": "2013-08-28T13:39:33.000+0000" }, { "id": "268888", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Is this happening for images above a specific size? Also what is the java error you are getting? Is hardware acceleration turned on in the device?\nThere is some limitation in Android showing large image in ImageView with HW acceleration enabled.\nhttp://stackoverflow.com/questions/7428996/hw-accelerated-activity-how-to-get-opengl-texture-size-limit\n\n", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-29T17:22:16.000+0000", "updated": "2013-08-29T17:22:16.000+0000" }, { "id": "268901", "author": { "name": "josh.magalich@crompco.com", "key": "josh.magalich@crompco.com", "displayName": "Josh Magalich", "active": true, "timeZone": "America/New_York" }, "body": "The runtime error I get is \"Uncaught Error: Java exception occurred\" Then it tells me my source which is \"var blob = e.media.imageAsResized(640, 480);\"\r\n\r\nAs for the image size/resolution, if I add 4-5 images of 3264x2448 (2.4 mb each) or like 20 images of of 640x480 (138 Kb each), it throws the error.\r\n\r\nI do not have hardware acceleration on. I am testing this on my Samsung Galaxy S3. Thanks.\r\n", "updateAuthor": { "name": "josh.magalich@crompco.com", "key": "josh.magalich@crompco.com", "displayName": "Josh Magalich", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-29T18:02:37.000+0000", "updated": "2013-08-29T18:02:37.000+0000" }, { "id": "268907", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi [~sunila],\r\n\r\nYes [~josh.magalich@crompco.com],Same result for me also. I also tested in S3 and HTC low/mid end model.\r\n\r\nI thought it working with small images (Screenshot images). Because I did not tried with 10+ images... May be it seems that also failing after 20 images.\r\n\r\nOnly we are facing this problem in Android.\r\n\r\nThank you", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-29T18:30:08.000+0000", "updated": "2013-08-29T18:30:08.000+0000" }, { "id": "269231", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I am able to reproduce the problem, it looks like out of memory error. Since Android allocate fixed size of memory to each application, I don't think there is anything can be done in the code other than scaling the image to smaller size.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-02T17:51:21.000+0000", "updated": "2013-09-02T17:51:21.000+0000" }, { "id": "269250", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi [~sunila],\r\n\r\nYes It is memory error. But, when I run with Ti SDK 3.0.2 GA version I can upload few more(6-8) images. But, when I run in 3.1.1 it is showing Java error in 3rd images itself. Can you please check same code in 3.0.2.\r\n\r\nThank you", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-03T05:06:02.000+0000", "updated": "2013-09-03T05:16:07.000+0000" }, { "id": "269456", "author": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I can add multiple images if i resize the captured image and use it in imageView.\r\nNumber of images i can add depends upon resized image size.\r\nAvailableMemory API does not seems to be reliable here, so better alternative should be built in SDK to capture such issue and confirm that, by checking availableMemory.", "updateAuthor": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-04T11:20:50.000+0000", "updated": "2013-09-04T11:23:55.000+0000" }, { "id": "270540", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi [~sunila],\r\n\r\nHave you tested same code in Ti SDK 3.0.2 GA version. It works fine with that version. when I run with 3.1.1 only it is showing Java error in two or third image.\r\n\r\ncc [~anigam]", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-10T06:06:47.000+0000", "updated": "2013-09-10T06:06:47.000+0000" }, { "id": "273824", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-04T18:01:00.000+0000", "updated": "2013-10-04T18:01:00.000+0000" }, { "id": "415173", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as \"Won't Fix\".", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:54:15.000+0000", "updated": "2017-03-22T22:54:15.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }