{ "id": "97772", "key": "TIMOB-10080", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "97771", "key": "TIMOB-10079", "fields": { "summary": "TiAPI: Achieve parity for Ti.Blob methods", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-11-13T21:42:37.000+0000", "created": "2012-07-23T09:43:45.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_imageview", "parity", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "20427", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "99804", "key": "AC-2408", "fields": { "summary": "[android] imageview does not respect image ratio if imageview width/height changed after creation", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "20348", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "99802", "key": "AC-2485", "fields": { "summary": "[android]when creating a blob from an image, width and height are not set", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-03T12:52:04.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": "Parity ticket see parent ticket for details on missing methods.", "attachment": [], "flagged": false, "summary": "Android: Parity for Ti.Blob methods", "creator": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "215960", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We should take a look at github.com/yagitoshiro/ImageAsResized for the Android platform.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-23T21:51:53.000+0000", "updated": "2012-08-23T21:51:53.000+0000" }, { "id": "215998", "author": { "name": "mbelkin", "key": "mbelkin", "displayName": "Michael Belkin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This module is generally good but crashes when resizing large images (such as those directly from the phone's camera).", "updateAuthor": { "name": "mbelkin", "key": "mbelkin", "displayName": "Michael Belkin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-24T07:23:50.000+0000", "updated": "2012-08-24T07:23:50.000+0000" }, { "id": "216108", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For functional test:\r\n1. Run the test code below.\r\n2. Click \"Open Gallery\" and choose one image.\r\n3. Click the other buttons to check the functionality of the new methods.\r\n4. Repeat step 2-3 if needed.\r\nNote:\r\ni) If the original image size is very large, \"Add Transparent Border\" and \"Add Rounded Corners\" may result in a crash due to memory issues. End developers should pre-process (eg. crop or resize) images before adding a border or rounded corners.\r\nii) \"Thumbnail Image\", \"Add Transparent Border\" and \"Add Rounded Corners\" will add a transparent border to the image. Since the background color for the imageview is blue, you will see a \"blue\" border around the image.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"black\"\r\n});\r\nvar currentImage = null;\r\n\r\nvar openGallery = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 0,\r\n\ttitle : \"Open Gallery\"\r\n});\r\nvar cropButton = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 50,\r\n\ttitle : \"Crop Image\"\r\n});\r\nvar resizeButton = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 100,\r\n\ttitle : \"Resize Image\"\r\n});\r\nvar thumbnailButton = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 150,\r\n\ttitle : \"Thumbnail Image\"\r\n});\r\nvar borderButton = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 200,\r\n\ttitle : \"Add Transparent Border\"\r\n});\r\nvar cornerButton = Ti.UI.createButton({\r\n\theight : 50,\r\n\ttop : 250,\r\n\ttitle : \"Add Rounded Corners\"\r\n});\r\nvar imgView = Ti.UI.createImageView({\r\n\tbackgroundColor : 'blue',\r\n\ttop : 300\r\n});\r\n\r\nopenGallery.addEventListener(\"click\", function() {\r\n\tTitanium.Media.openPhotoGallery({\r\n\t\tsuccess : function(event) {\r\n\t\t\tvar image = event.media;\r\n\t\t\tcurrentImage = image;\r\n\t\t\timgView.width = currentImage.width / 5;\r\n\t\t\timgView.height = currentImage.height / 5;\r\n\t\t\timgView.image = currentImage;\r\n\r\n\t\t\tTi.API.info(\"************original: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\r\n\t\t},\r\n\t\tcancel : function() {\r\n\t\t},\r\n\t\terror : function(error) {\r\n\t\t},\r\n\t\tsaveToPhotoGallery : false,\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n});\r\n\r\ncropButton.addEventListener(\"click\", function() {\r\n\tif (currentImage !== null) {\r\n\t\tvar croppedImg = currentImage.imageAsCropped({\r\n\t\t\twidth : currentImage.width / 4,\r\n\t\t\theight : currentImage.height / 4\r\n\t\t});\r\n\t\timgView.width = croppedImg.width;\r\n\t\timgView.height = croppedImg.height;\r\n\t\timgView.image = croppedImg;\r\n\t\tcurrentImage = croppedImg;\r\n\t\tTi.API.info(\"************cropped: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\t}\r\n});\r\n\r\nresizeButton.addEventListener(\"click\", function() {\r\n\tif (currentImage !== null) {\r\n\t\tvar resizeImg = currentImage.imageAsResized(300, 400);\r\n\t\timgView.width = resizeImg.width;\r\n\t\timgView.height = resizeImg.height;\r\n\t\timgView.image = resizeImg;\r\n\t\tcurrentImage = resizeImg;\r\n\t\tTi.API.info(\"************resized: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\t}\r\n});\r\nthumbnailButton.addEventListener(\"click\", function() {\r\n\tif (currentImage !== null) {\r\n\t\tvar thumbnailImg = currentImage.imageAsThumbnail(200, 10, 20);\r\n\t\timgView.width = thumbnailImg.width;\r\n\t\timgView.height = thumbnailImg.height;\r\n\t\timgView.image = thumbnailImg;\r\n\t\tcurrentImage = thumbnailImg;\r\n\t\tTi.API.info(\"************thumbnail: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\t}\r\n});\r\n\r\nborderButton.addEventListener(\"click\", function() {\r\n\tif (currentImage !== null) {\r\n\t\tvar borderImg = currentImage.imageWithTransparentBorder(10);\r\n\t\timgView.width = borderImg.width;\r\n\t\timgView.height = borderImg.height;\r\n\t\timgView.image = borderImg;\r\n\t\tcurrentImage = borderImg;\r\n\t\tTi.API.info(\"************added border: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\t}\r\n});\r\n\r\ncornerButton.addEventListener(\"click\", function() {\r\n\tif (currentImage !== null) {\r\n\t\tvar cornerImg = currentImage.imageWithRoundedCorner(20);\r\n\t\timgView.width = cornerImg.width;\r\n\t\timgView.height = cornerImg.height;\r\n\t\timgView.image = cornerImg;\r\n\t\tcurrentImage = cornerImg;\r\n\t\tTi.API.info(\"************rounded corners: width = \" + currentImage.width + \", height = \" + currentImage.height);\r\n\t}\r\n});\r\n\r\nwin.add(openGallery);\r\nwin.add(cropButton);\r\nwin.add(resizeButton);\r\nwin.add(thumbnailButton);\r\nwin.add(borderButton);\r\nwin.add(cornerButton);\r\nwin.add(imgView);\r\nwin.open(); \r\n{code}\r\n", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-24T17:26:54.000+0000", "updated": "2012-08-24T17:28:04.000+0000" }, { "id": "216109", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/2833", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-24T17:33:57.000+0000", "updated": "2012-08-24T17:33:57.000+0000" }, { "id": "216111", "author": { "name": "rachidi", "key": "rachidi", "displayName": "Mohamed Rachidi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Glad to see this implemented. But have you looked into using inSampleSize to return a smaller image for memory management? \r\n\r\nThanks ", "updateAuthor": { "name": "rachidi", "key": "rachidi", "displayName": "Mohamed Rachidi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-24T17:43:59.000+0000", "updated": "2012-08-24T17:43:59.000+0000" }, { "id": "227185", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and verified fix with:\r\nTitanium Studio, build: 3.0.0.201211071923\r\nTitanium SDK, build: 3.0.0.v20121112140159\r\nDevice:\r\nNexus7 4.1.2\r\nThe behavior as described above.\r\nClosing as fixed.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-13T21:12:29.000+0000", "updated": "2012-11-13T21:42:28.000+0000" }, { "id": "228043", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The test app does not include the test for \"imageWithAlpha\". This function adds an alpha channel to the image but the alpha value is 255 for the whole image which means the image is opaque. So we can not tell the difference between the input and the output image by eyes.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-20T19:05:42.000+0000", "updated": "2012-11-20T19:05:42.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }