Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1355] 3.5.0.GA No longer uses Retina images with image from string

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-01-26T20:48:50.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labels3.5.0, @2ximages, retina
ReporterHilko Lantinga
AssigneeMauro Parra-Miranda
Created2015-01-19T21:37:38.000+0000
Updated2016-03-08T07:37:46.000+0000

Description

The only way to load Retina images with a string on 3.5.0 is with something like:
if (density === 'high') {
    image = image.replace('.jpg', '@2x.jpg');
    image = image.replace('.png', '@2x.png');
}
imageView = Ti.UI.createImageView({
    top : 1,
    left : 1,
    backgroundImage : Ti.Filesystem.applicationDataDirectory + image
});
With 3.4.1 it works without inserting @2x in to the string.

Attachments

FileDateSize
image.png2015-01-26T20:46:54.000+0000798136
image@2x.png2015-01-26T20:46:54.000+00002264946

Comments

  1. Mauro Parra-Miranda 2015-01-26

    Hello, we can't reproduce your issue. How to test it? 1. Create a new mobile project classic titanium 2. Copy the image.png and image@2x.png attached to the ticket, copy it to the Resources Directory 3. Replace app.js to:
       var win = Ti.UI.createWindow({
       	backgroundImage:'image.png',
       });
       
       win.open();
       
    4. Run it in a retina device. You will see that the image being shown is the image@2x.png, as expected.
  2. Hilko Lantinga 2015-01-26

    I'm not loading them from Resources, but from the application data directory (images are downloaded from http server first).

JSON Source