{ "id": "78121", "key": "TIMOB-4884", "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": "12096", "description": "", "name": "Sprint 2012-04", "archived": true, "released": true, "releaseDate": "2012-02-26" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-15T10:30:33.000+0000", "created": "2011-07-22T09:38:01.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_imageview", "qe-testadded" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-03-06T11:17:30.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "If you call {{var a = view.toImage()}} on a view, and set an ImageView to that blob i.e. {{imageView.image = a}}\r\non an Iphone with retina display, then the image is displayed at normal resolution and thus is pixelated on an iPhone 4.\r\n\r\nThere is a very simple fix to this already out there in the wild, see [https://github.com/iamyellow/titanium_mobile/|https://github.com/iamyellow/titanium_mobile/commit/b7ac93e257339e60510a88a5767455f6b1120034#iphone/Classes/TiViewProxy.m]\r\n\r\nI would recommend that change is made to all appropriate UI controls which have a toImage() method. \r\n\r\n{code:javascript|title=app.js}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#FFF'\r\n});\r\n\r\nvar sourceView = Titanium.UI.createView({\r\n width: 155,\r\n left: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\n\r\nsourceView.add(Titanium.UI.createLabel({\r\n text: 'Here is some nice smooth antialised text',\r\n font: { \r\n fontSize: 20\r\n }\r\n}));\r\n\r\nvar targetView = Titanium.UI.createImageView({\r\n width: 155,\r\n right: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\n\r\nvar btn = Titanium.UI.createButton({\r\n title: 'Copy image to target on right',\r\n width: 300,\r\n height: 30,\r\n bottom: 10\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n targetView.image = sourceView.toImage();\r\n});\r\n\r\nwin.add(btn);\r\nwin.add(targetView);\r\nwin.add(sourceView);\r\nwin.open();\r\n{code}\r\n\r\nPlease remember this issue is only visible when using an iOS 4 Retina Device.", "attachment": [], "flagged": false, "summary": "toImage() on device with retina display is pixellated (captured at half resolution)", "creator": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK version: 1.7.2.97c3689\r\n* Platform & version: iOS 4.3, OSX 10.7 (Lion)\r\n* Device Details: iOS simulator and iOS device when using RETINA display\r\n* Host Operating System: OSX 10.7\r\n* Titanium Studio build: 1.0.2.201107130739", "comment": { "comments": [ { "id": "160455", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Matthew\r\n\r\nThank you for the ticket. In order for us to progress it, we need a proper [usecase|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases] that can be used to demonstrate the issue and also confirm that the subsequent bugfix works.\r\n\r\nAlso, please check the ticket against the [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist] in order to complete some of the fields.\r\n\r\nMany thanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-07-25T07:25:46.000+0000", "updated": "2011-07-25T07:25:46.000+0000" }, { "id": "161124", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Paul\r\n\r\nOk, here goes, think this is all the info you need. Do remember that a fix already exists (which I have tested) at https://github.com/iamyellow/titanium_mobile/commit/b7ac93e257339e60510a88a5767455f6b1120034#iphone/Classes/TiViewProxy.m\r\n\r\nEnvironment:\r\n\r\nTitanium SDK version: 1.7.2 (I don't see where build date / hash comes from, I am using the version that was automatically installed by Titanium Studio when 1.7.2 was released a week or so ago). I see an [INFO] log saying something about 1.7.2.97c3689, is that what you need?\r\nPlatform & version: iOS 4.3, OSX 10.7 (Lion)\r\nDevice Details: iOS simulator and iOS device when using RETINA display\r\nHost Operating System: OSX 10.7\r\nTitanium Studio version: Titanium Studio, build: 1.0.2.201107130739\r\n\r\nCode for app.js example\r\n\r\n{code:javascript}\r\n\r\nvar sourceView = Titanium.UI.createView({\r\n width: 155,\r\n left: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\nsourceView.add(Titanium.UI.createLabel({\r\n text: 'Here is some nice smooth antialised text',\r\n font: { \r\n fontSize: 20\r\n }\r\n}));\r\n\r\nvar targetView = Titanium.UI.createImageView({\r\n width: 155,\r\n right: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\n\r\nvar btn = Titanium.UI.createButton({\r\n title: 'Copy image to target on right',\r\n width: 300,\r\n height: 30,\r\n bottom: 10\r\n});\r\nbtn.addEventListener('click', function() {\r\n targetView.image = sourceView.toImage();\r\n});\r\n\r\nvar win = Titanium.UI.currentWindow;\r\nwin.add(btn);\r\nwin.add(targetView);\r\nwin.add(sourceView);\r\n{code}\r\n\r\nPlease remember this issue is only visible when using an iOS 4 Retina Device.\r\n\r\nHope that helps, shout if you need anything else.\r\n\r\nMatt", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-29T08:01:56.000+0000", "updated": "2011-07-29T08:01:56.000+0000" }, { "id": "161614", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Matt\r\n\r\nIt's getting there, but unfortunately the code will not run without modification (it doesn't contain the window creation statement). Please refer to the [Creating Good Use-cases|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases] guide for more info on this.\r\n\r\nYou should be able to edit the ticket itself and enter the new information to the relevant fields.\r\n\r\nThanks for your cooperation so far. Once the above is done, I can move the ticket to the correct project. ", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-02T18:00:52.000+0000", "updated": "2011-08-02T18:00:52.000+0000" }, { "id": "161638", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Come on Paul, you are being very difficult now. I provided perfectly good working code that you can use VERY easily by simply creating a window with this code, and you are just not trying to help. I am contributing to your product to help improve it, and you're not being cooperative. I am really surprised at this attitude from Appcelerator as you have a product that is far from perfect, and you have people like myself who are trying to help improve it with constant resistance and bureaucracy.\r\n\r\nThe reason this code did not run is that because Titanium Mobile has so many bugs, I've created a single project with multiple files in it that are created using a tab system, so that I don't have to create a new project for every bug I come across, I simply add a new tab, and create a new JS file for that tab. So to get my example to work, all you need to do is change the file name of app.js to bug.js, and in app.js use the following code:\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#FFF',\r\n url: 'bug.js'\r\n});\r\nwin.open();\r\n{code}\r\n\r\nI can't believe I had to provide you with that code.\r\n\r\nMaybe you should read this, http://www.jacquesmattheij.com/How+not+to+handle+open+source+feedback\r\n \r\n\r\n", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-02T23:18:24.000+0000", "updated": "2011-08-02T23:20:00.000+0000" }, { "id": "161686", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-03T08:48:21.000+0000", "updated": "2011-08-03T08:48:21.000+0000" }, { "id": "161767", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for pushing this through", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T15:10:16.000+0000", "updated": "2011-08-03T15:10:16.000+0000" }, { "id": "174220", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Odd question: What about those of whom who want a non-retina image? As in, I can see someone using the toImage to compose a graphic of a known pixel size. By always using retina scale, it would break their code. I'm thinking we should keep the 1.0 scale for backwards compatibility, but offer that toImage takes an optional argument object property to indicate that things can be made for 2.0 scale.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-29T15:15:03.000+0000", "updated": "2011-11-29T15:15:03.000+0000" }, { "id": "183063", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Use this for testing\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#FFF'\r\n});\r\n\r\nvar sourceView = Titanium.UI.createView({\r\n width: 155,\r\n left: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\n\r\nsourceView.add(Titanium.UI.createLabel({\r\n text: 'Here is some nice smooth antialised text',\r\n font: { \r\n fontSize: 20\r\n }\r\n}));\r\n\r\nvar targetView = Titanium.UI.createImageView({\r\n width: 155,\r\n right: 5,\r\n height: 240,\r\n borderWidth: 1,\r\n borderColor: '#000'\r\n});\r\n\r\nvar btn = Titanium.UI.createButton({\r\n title: 'Copy image to target on right',\r\n width: 300,\r\n height: 30,\r\n bottom: 10\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n targetView.image = sourceView.toImage(null,true);\r\n});\r\n\r\nwin.add(btn);\r\nwin.add(targetView);\r\nwin.add(sourceView);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-14T11:10:57.000+0000", "updated": "2012-02-14T11:10:57.000+0000" }, { "id": "183065", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/1416", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-14T11:16:41.000+0000", "updated": "2012-02-14T11:16:41.000+0000" }, { "id": "183202", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request https://github.com/appcelerator/titanium_mobile/pull/1416 merged.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-15T10:30:33.000+0000", "updated": "2012-02-15T10:30:33.000+0000" }, { "id": "185182", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 2.0.0.v20120305174654\r\nTitanium Studio, build: 1.0.9.201202141208\r\nxcode: 4.2\r\nDevice: iphone 4S (5.0.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-06T10:43:31.000+0000", "updated": "2012-03-06T10:43:31.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }