{ "id": "63451", "key": "TIMOB-2819", "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": "11240", "name": "Release 1.6.0 M07", "archived": true, "released": true, "releaseDate": "2011-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:10.000+0000", "created": "2011-04-15T03:30:21.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "2x", "image", "ios", "regression", "release-1.6.0", "retina" ], "versions": [], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T02:00:10.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": "{html}

notes from, #1543 (#2805 has also been logged against 2X\nimage scaling). Works as expected in 1.5.1 [INFO] Titanium SDK version: 1.6.0 (01/12/11\n09:38 db09d1e)

\n

\"The 2x image loaded, but it seems that the image scaling code\nwas not modified to take this into account. 2x images appear\nvisually to be half the size they should be. Example:
\nI have a 60x60 Ti.UI.ImageView. On a iPhone 3, my remote image\nloads, and is scaled to fill the 60x60 space.
\nHowever, on an iPhone 4, the high-res image seems to have scaled to\nonly take up half of the space. I believe the image scaled to\nliterally 60x60px, instead of 60x60 points on the screen (aka\n120x120px).
\nMy code:

\n
\n// left image\nvar updateImage = Titanium.UI.createImageView({\n    defaultImage:'images/loading_60.png',\n    image:thisUpdate.updateCauseIcon,\n    top:5,\n    left:10,\n    width:60,\n    height:60\n});\n// iPhone 4 display\nif (Titanium.Platform.displayCaps.dpi == 320) {\n    updateImage.image = thisUpdate.updateCauseIcon2x;\n    updateImage.hires = true;\n}\n
{html}", "attachment": [], "flagged": false, "summary": "iOS - loading a @2x image with hires set to true does not scale to imageView", "creator": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129489", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Going to have to dig deeper on that. Do we have the sample\nimages so I can understand the context? Is there an images/loading_60@2x.png that's being\nshrunk?

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:22.000+0000", "updated": "2011-04-15T03:30:22.000+0000" }, { "id": "129490", "author": { "name": "mellomike", "key": "mellomike", "displayName": "MelloMike", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Blain, this only happens with remote images, not images in\nthe resources folder with @2x.png. So for example:

\n

and UI.Image component with the following properties

\n

imageComponent.image = http://example.com/image200x200.jpg;
\nimageComponent.width = 200;
\nimageComponent.height = 200;
\nimageComponent.hires = true;

\n

As you can see the Image being pulled from the web is 200x200 ..\nand the image component in the app is 200x200. However when the\nimage loads into the component it'll be scaled down 50% to 100x100.\nThe bounds of the imageComponent is still 200x200.

\n

imageComponent
\n----------------- |-------- | | | | | | | | | |\n|-------- | | | | | -----------------

{html}", "updateAuthor": { "name": "mellomike", "key": "mellomike", "displayName": "MelloMike", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:23.000+0000", "updated": "2011-04-15T03:30:23.000+0000" }, { "id": "129491", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

You do realize that the hires property was made explicitly to\ntreat the image as a hi-res image, and like @2x local images, show\nthe image at 50% where one pixel in the graphic maps to one\nphysical pixel onscreen?

\n

That is, imageComponent.image MUST 400 pixels by 400 pixels in\norder to fill a logical 200*200?

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:23.000+0000", "updated": "2011-04-15T03:30:23.000+0000" }, { "id": "129492", "author": { "name": "mellomike", "key": "mellomike", "displayName": "MelloMike", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Blain, sorry I gave you that example wrong.

\n

if the imageComponent.width and height are both 100 ... and the\nimage is 200x200 ... the image will still be scaled 50% .. so the\nimage will actually be 50x50 inside the imageComponent

\n

Sorry for the mixup.

{html}", "updateAuthor": { "name": "mellomike", "key": "mellomike", "displayName": "MelloMike", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:24.000+0000", "updated": "2011-04-15T03:30:24.000+0000" }, { "id": "129493", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [955e9a133c8613d76c8df7fdff28716832268175])\n[#2819 state:fixed-in-qa] There's a more elegant\nway, but this works for now. \nhttps://github.com/appcelerator/titanium_mobile/commit/955e9a133c86...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:24.000+0000", "updated": "2011-04-15T03:30:24.000+0000" }, { "id": "129494", "author": { "name": "shannon", "key": "shannon", "displayName": "Shannon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

jhaynie: I just tried with build \"Jan 25 2011 13:35 r1f1dd51d\",\nand I'm not finding any change. Yes, I tried emptying out the\nbuild/iphone directory and doing a clean build. In fact, it looks\nlike a step backwards, as now my defaultImage is displaying at half\nthe correct size. Here's a code example with URL for you to\ntest:

\n
\nvar beerImage = Titanium.UI.createImageView({\n    defaultImage:'images/loading_60.png',\n    image:'http://beerimages.pintley.com/2948/PietraVerre25cl_mobileThumb.png',\n    width:60,\n    height:60\n});\n// iPhone 4 display\nif (Titanium.Platform.displayCaps.dpi == 320) {\n    beerImage.image = 'http://beerimages.pintley.com/2948/PietraVerre25cl_web.png';\n    beerImage.hires = true;\n}\nmyView.add(beerImage);\n
\n

Note that the hires image is actually bigger than needed, it's\n141x141, not 120x120 as you might expect.

{html}", "updateAuthor": { "name": "shannon", "key": "shannon", "displayName": "Shannon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:24.000+0000", "updated": "2011-04-15T03:30:24.000+0000" }, { "id": "129495", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

hey Shannon, please try a more recent pull.

\n

closing against [INFO] Titanium SDK version: 1.6.0 (02/02/11\n07:59 a632082) ipod 4GT (4.2.1) and 4.1

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:25.000+0000", "updated": "2011-04-15T03:30:25.000+0000" }, { "id": "129496", "author": { "name": "shannon", "key": "shannon", "displayName": "Shannon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

PERFECT! Thanks for the fast work on this one guys, it was a\nreal showstopper for my app!

{html}", "updateAuthor": { "name": "shannon", "key": "shannon", "displayName": "Shannon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:25.000+0000", "updated": "2011-04-15T03:30:25.000+0000" }, { "id": "129497", "author": { "name": "hamii", "key": "hamii", "displayName": "hamii", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

How about the coverflow object? How can we set \"hires\" on it? I\ncertainly can see checking for the higher dpi, but I don't see\nanyway to tell the object that the images are \"hires\".

\n

Love to hear your thoughts.

{html}", "updateAuthor": { "name": "hamii", "key": "hamii", "displayName": "hamii", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:25.000+0000", "updated": "2011-04-15T03:30:25.000+0000" }, { "id": "129498", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Coverflow does not support remote hires images.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:25.000+0000", "updated": "2011-04-15T03:30:25.000+0000" }, { "id": "129499", "author": { "name": "hamii", "key": "hamii", "displayName": "hamii", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

How unfortunate. It is a great control and is of little value\nfor the Retna display devices. Would be a great enhancement to\nhave.

{html}", "updateAuthor": { "name": "hamii", "key": "hamii", "displayName": "hamii", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:26.000+0000", "updated": "2011-04-15T03:30:26.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }