Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10046] iOS: Handle Invalid image type exception gracefully - application crashes with exception if url of image has 'space(s)' in it.

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelscore
ReporterAnirudh Nagesh
AssigneeUnknown
Created2012-07-19T15:32:56.000+0000
Updated2018-02-28T20:03:43.000+0000

Description

Run the below sample code in app.js
var window = Titanium.UI.createWindow({
  
});

var text_with_space_in_it = 'lfjdhljaksfh a sfa sasf';
var imageview = Ti.UI.createImageView({
	
	image:'http://i.ytimg.com/vi/' + text_with_space_in_it + '/2.jpg',
	
	
})
 
// work around is to replace the spaces with %20 or encode the uri
window.add(imageview);
window.open();
Work Around:
 var spaces = new RegExp(' ','g'); var imgurl = url.replace(spaces,'%20');
OR
 var encoded = encodeURI('http://abc.com/file name.png');
Log from the customer project is attached.

Attachments

FileDateSize
log.txt2012-07-19T15:32:56.000+00003474

Comments

  1. Shameer Jan 2013-04-10

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0

JSON Source