Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15044] Android:ImageView does not properly handle '@' symbol in URL

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2014-05-27T15:53:43.000+0000
Affected Version/sRelease 3.1.0, Release 3.1.1, Release 3.1.2, Release 3.3.0
Fix Version/sRelease 3.2.0
ComponentsAndroid
Labelsmodule_imageview, qe-testadded, supportTeam
ReporterRupesh Sharma
AssigneeDeepti Pandey
Created2013-09-05T09:41:59.000+0000
Updated2014-06-19T12:42:45.000+0000

Description

Description

ImageView path that contain a '@' symbol will not get handled properly by ImageView on Android. But the correct image is loaded when the application is run a second time.

TestCase

I made a test app that should load two remote images, one with an '@' symbol in the URL and one without. Now for the first time it will not show the correct image, however from second time onwards will show the correct image.
var win = Ti.UI.createWindow({
	backgroundColor : 'white',
	layout:'vertical'
});
var image1 = Ti.UI.createImageView({
	image : 'http://media.reliancenetwork.com/dyna_images/mls/3555/1329678.jpg',
	width : '320dip',
	height : '240dip'
	
});

var image2 = Ti.UI.createImageView({
	image : 'http://cdn-1.eneighborhoods.com/x1/@v=-1855096842@/2611/692/1332692/1332692_1.jpg',
	width : '320dip',
	height : '240dip'
});
win.add(image1);
win.add(image2);
win.open();

Attachments

FileDateSize
console_logs.txt2014-05-27T10:28:24.000+000016453
Screenshot.png2014-05-27T10:47:49.000+00001105379

Comments

  1. Robert Chrzanowski 2013-09-05

    Also worth noting is that the second time the image is loaded it is from the android image cache. It appears that the cache will correctly handle '@' symbols in the url. Running the following code snippet before loading the ImageView will consistently cause the wrong image to load.
       (function zapImageCache() {
         var appDataDir, cacheDir, dir, externalRoot;
         if (Ti.Filesystem.isExternalStoragePresent()) {
           appDataDir = Ti.Filesystem.getFile('appdata://').nativePath;
           externalRoot = appDataDir.substring(0, appDataDir.lastIndexOf('/'));
           cacheDir = "" + externalRoot + "/Android/data/" + Ti.App.id + "/cache/_tmp/remote-cache";
           dir = Ti.Filesystem.getFile(cacheDir);
         } else {
           dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory, '_tmp', 'remote-cache');
         }
         if (dir.exists()) {
           dir.deleteDirectory(true);
         }
       }());
       
  2. Sunila 2013-09-12

    Exclude valid characters for path segment in URL from encoding https://github.com/appcelerator/titanium_mobile/pull/4679
  3. Priya Agarwal 2013-10-10

    Verified the Fix with: Appc-Studio: 3.2.0.201310100354 Sdk:3.2.0.v20131009134844 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3),ipodTouch1(v7.0) Xcode: 5 ImageView having '@' symbol in url of image property for ImageView is working fine.
  4. Deepti Pandey 2014-05-27

    Reopening this ticket as ImageView path that contain a '@' symbol does not show up .Also its not showing any placeholder but just a blank space. This is not a regression . Configurations used are: Mac :10.9.3 Appcelerator Studio, build:3.3.0.201405211748 SDK - 3.3.0.v20140524224144 acs-1.0.14 alloy@1.4.0-alpha4 npm-1.3.2 titanium@3.3.0-alpha5 titanium-code-processor-1.1.1 Xcode :5.1.1 Devices Used: Nexus 5 (4.4.2), Nexus 7 (4.3) Android SDK tools : 22.6.3 Screenshot and logs attached.
  5. Sunila 2014-05-27

    I think the code is behaving correctly. The URL ''http://cdn-1.eneighborhoods.com/x1/@v=-1855096842@/2611/692/1332692/1332692_1.jpg' is returning a 503 - Service unavailable (even though the response still return an image) Here is the response captured through fiddler for the above url from the browser HTTP/1.1 503 Service Unavailable Server: Microsoft-IIS/6.0 Server: CDN01 Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: * X-Powered-By: ASP.NET Access-Control-Allow-Headers: No-Image No-Image: true Content-Type: image/jpeg Content-Length: 16978 Cache-Control: private, max-age=0 Expires: Tue, 27 May 2014 15:37:40 GMT Date: Tue, 27 May 2014 15:37:40 GMT Connection: keep-alive Try the below url http://cdn-1.eneighborhoods.com/x2/@v=-1936834507@/2611/4/475/1406475/1406475_1.jpg
  6. Sunila 2014-05-27

    See the comments, the url in the sample is no longer valid.
  7. jesse newcomer 2014-05-27

    the images come and go based off of home sales. if you need other examples go to a property details page on remax.com and right click>view image in the carousel to get more valid images with @ in the url. this is a very high priority for the remax app as nearly all of our details images contain @
  8. Ingo Muschenetz 2014-05-27

    [~n3wc] Please add a test case that describes your issue.
  9. jesse newcomer 2014-05-27

    My apologies, I got the notification from Deepti about reopening the ticket and responded before verifying personally. I downloaded 3.3.0.v20140524224144 and tried to reproduce with both remote and local images with @ in the path and was not able to reproduce on a samsung galaxy tab or nexus 4. I did not update to Appcelerator Studio, build:3.3.0.201405211748 or alloy@1.4.0-alpha4
  10. Deepti Pandey 2014-06-03

    Verified that ImageView properly handles '@' symbol in URL when used images link given by Sunila. Hence closing this ticket. Appc Studio: 3.3.0.201405271647 SDK build: 3.3.0.v20140602174112 acs: 1.0.14 npm: 1.3.2 alloy: 1.4.0-beta CLI: titanium-3.3.0-beta2 titanium-code-processor:1.1.1 Xcode: 5.1.1 OS: Mavericks 10.9.3
  11. Deepti Pandey 2014-06-03

    Closing as Invalid ticket.

JSON Source