[TIMOB-12885] image property of Image View or backgroundImage property of View, does not handle URL redirect and does not load remote images.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2018-08-30T02:33:56.000+0000 |
Affected Version/s | Release 3.0.0, Release 3.0.1, Release 3.0.2 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Ashish Nigam |
Assignee | Unknown |
Created | 2013-02-27T05:13:26.000+0000 |
Updated | 2018-08-30T02:33:56.000+0000 |
Description
image property of Image View or backgroundImage property of View, does not handle URL redirect and does not load remote images.
Test Case, create a new allow project and then change the code to.
**Sample Code**
=>index.tss file code
".container": {
backgroundColor:"white"
},
"#icon": {
top:10,
left:10,
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
borderColor:"red",
borderWidth:2
}
=>index.js file code
var imageUrl = " https://www.poweruprewards.com/SiteResources/i/catalog/lg/PaddysSnuggieL.jpg";
$.icon.image = imageUrl;
$.index.open();
setTimeout(function(){
$.icon.image = "/PaddysSnuggieL.jpg";
},10000);
=>index.xml file code
<Alloy>
<Window class="container">
<ImageView id="icon"></ImageView>
</Window>
</Alloy>
1: Run sample as it is.
Test Result: failed
Reason: Image does not load and the error for max retry reached.
2: Run sample with this URL, URL = http://www.mapsofindia.com/maps/india/india-large-color-map.jpg
Test Result: Passed
Reason: Image Shows up properly.
3: Run sample with Both URL and using one URL with timeout method
Test Result: Passed for URL = http://www.mapsofindia.com/maps/india/india-large-color-map.jpg and failed for second.
Reason: Image Shows up properly.
4: Run sample with the image (PaddysSnuggieL.jpg and india-large-color-map.jpg) in URL saved locally in assets folder.
TestResult: Passed for both the images.
Reason: both images shows up properly.
I have a similar issue on Android and 3.0.0/3.0.2. Might be related. Loading images from the web works, but when the image url is a dynamic source (.php) it won't show (Android issue only). First encountered using Alloy, but can reproduce the issue using Ti Classic single window app:
The .gif will show (when uncommented), but the image from icondirect.php not. The content type of the response is "image/jpeg".
This bug impacts Facebook now: profile images, retrieved with http://graph.facebook.com/fb_id/picture are redirected. The only workaround is to separately request direct profile picture urls, which is so inconvenient.
Re-assigning to triage.
may we have a status update on this issue please.
I believe the same is true for Android.
I've re-tested with Titanium 7.3.0. The following URL successfully loads the image... http://api.coldtrick.com/mod/profile/icondirect.php?lastcache=1357651348&joindate=1357651236&guid=41&size=medium The following URL, which involves a redirect from http to https, successfully loads the image too... http://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Portrait_1.jpg The following URL fails to load the image because the website has an invalid certificate. This is the correct behavior in this case. https://www.poweruprewards.com/SiteResources/i/catalog/lg/PaddysSnuggieL.jpg I'm going to close this ticket. The first 2 URLs I've tested have shown that this is resolved.