[TIMOB-18262] iOS: Cannot load images from the applicationDataDirectory
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-12-19T22:50:46.000+0000 |
Affected Version/s | Release 3.5.0 |
Fix Version/s | Release 3.5.0, Release 4.0.0 |
Components | iOS |
Labels | ios, regression |
Reporter | David Bankier |
Assignee | Vishal Duggal |
Created | 2014-12-18T21:05:15.000+0000 |
Updated | 2014-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();
The test case shows two images in 3.4.1 but only one in 3.5.0.BETA
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
I believe this might be related to TIMOB-17582?
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.
PRs https://github.com/appcelerator/titanium_mobile/pull/6517 https://github.com/appcelerator/titanium_mobile/pull/6516
CR failed
Pulls pending master - https://github.com/appcelerator/titanium_mobile/pull/6520 3_5_X - https://github.com/appcelerator/titanium_mobile/pull/6521
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