Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10006] Android: Open 'image@2x.png' in Android webView displays as text

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-02-28T16:00:39.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsAndroid
Labelscore, exalture
ReporterJoe Falcone
AssigneeSunila
Created2012-05-17T03:00:54.000+0000
Updated2017-03-17T18:19:44.000+0000

Description

Opening an image file in a webView is a common solution to get pan and zoom for an image on Android. However, if the image is named @2x.png, the webView apparently gets confused and displays the image as text (see attachment) If the very same file is simply renamed -hd.png, then it is displayed correctly. It appears that the '@' symbol is being interpreted by the Android webView. I've tested it with a number of different valid png files.
var imagehd = 'images/hmb-logo@2x.png';
var webView = Ti.UI.createWebView ({
		url : imagehd,
		top : 0,
		left : 0,
		scalesPageToFit : false,
		enableZoomControls : true,
	});
win.add(webView);

Attachments

FileDateSize
device-2012-05-17-025034.png2012-05-17T03:00:54.000+0000271570

Comments

  1. Sunila 2013-02-28

    Tried with 3.1, I couldn't reproduce the problem. I can see the image properly.
  2. Joe Falcone 2014-02-11

    Reproduced the failure w/ Ti SDK 3.2.1 & Android 2.3.5 (HTC Inspire 4G). Works w/ Android 4.3 (Samsung Galaxy 3).
  3. Joe Falcone 2014-02-11

    Screenshot for Feb 11 comment above: [http://s27.postimg.org/lhevv9gwj/device_2014_02_11_135540.png] Original Image: [http://s9.postimg.org/ijj66retr/cms_map_2x.png]
  4. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source