Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18262] iOS: Cannot load images from the applicationDataDirectory

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-12-19T22:50:46.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 3.5.0, Release 4.0.0
ComponentsiOS
Labelsios, regression
ReporterDavid Bankier
AssigneeVishal Duggal
Created2014-12-18T21:05:15.000+0000
Updated2014-12-20T00:27:43.000+0000

Description

Images in ImageViews, tab icons,etc, can no longer be loaded from the applicationDataDirectory in 3.5.0.BETA Here is the sample code to replicate:
Titanium.UI.setBackgroundColor('#000');

var win2 = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#fff'
});

var image1 = Titanium.UI.createImageView({
  top: 10,
  image: "/appicon.png"
});

var icon = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'appicon.png');
var dest = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'appicon.png');

dest.write(icon.read());

var image2 = Titanium.UI.createImageView({
  bottom: 10,
  image: Ti.Filesystem.applicationDataDirectory  + 'appicon.png'
});

win2.add(image1);
win2.add(image2);

win2.open();

Comments

  1. David Bankier 2014-12-18

    The test case shows two images in 3.4.1 but only one in 3.5.0.BETA
  2. Eric Wieber 2014-12-18

    Verified that passing a string to the image property is not loading properly on iOS with SDK 3.5.0.Beta. [~jalter] suggested passing a file or blob to the property, which loaded as expected. The image property with string value also loads as expected using SDK 3.4.1.GA. Tested using: Titanium SDK 3.5.0.v20141217144815 Studio 3.4.1.201410281743 Xcode 6.1.1 On: iPad mini, iOS 8.1 iPhone 6, iOS 8.2b3 iPhone 4S Sim, iOS 8.1
  3. Ingo Muschenetz 2014-12-19

    I believe this might be related to TIMOB-17582?
  4. Eric Wieber 2014-12-19

    Further testing shows that passing a string to image property on Android is working as expected. However, the image does not load on Mobile Web, even when using SDK 3.4.1.GA.
  5. Pedro Enrique 2014-12-19

    PRs https://github.com/appcelerator/titanium_mobile/pull/6517 https://github.com/appcelerator/titanium_mobile/pull/6516
  6. Vishal Duggal 2014-12-19

    CR failed
  7. Vishal Duggal 2014-12-19

    Pulls pending master - https://github.com/appcelerator/titanium_mobile/pull/6520 3_5_X - https://github.com/appcelerator/titanium_mobile/pull/6521
  8. Eric Wieber 2014-12-20

    Verified fixed for image property, using: Titanium SDK 3.5.0.v20141219144914 Studio 3.4.1.201410281743 Xcode 6.1.1 On: iPad mini, iOS 8.1 iPhone 6, iOS 8.2b3 iPhone 4S Sim, iOS 8.1 Nexus 5, Android 5.0.1 Android emulator, 5.0.1-arm & 5.0.1 64 bit Genymotion emulator, Android 4.4.4

JSON Source