Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18765] iOS: Fix for uiimageview regression project name or file name has a space #6821

Merged
merged 2 commits into from May 7, 2015

Conversation

cheekiatng
Copy link
Contributor


result = [NSURL URLWithString:[relativeString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] relativeToURL:rootPath];
//only add percentescape if there are spaces in relativestring
if ([[relativeString componentsSeparatedByString:@" "] count] -1 == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work for the fix but it is not the right fix. For example if the image was specified as 'image%1.png' this if condition will fail and you would get a nil result.

The real problem is in ImageView loadUrl function where we are using
NSURL *url_ = [TiUtils toURL:[img absoluteString] proxy:self.proxy];

What we sould be using is
NSURL *url_ = [TiUtils toURL:[img path] proxy:self.proxy];

or the passed in img argument directly since it has already been converted to a URL

@vishalduggal
Copy link
Contributor

Code reviewed. CR/FR Failed.

@vishalduggal
Copy link
Contributor

You might also want to cleanup the
+(NSURL*)toURL:(NSString *)relativeString relativeToURL:(NSURL *)rootPath method in TiUtils.m
We have special handling of URL's with http and https schemes.

If - (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc; is performing the same functionality we should remove the block of code that transforms these remote URL's

@cheekiatng
Copy link
Contributor Author

Good point. Thanks!

@vishalduggal
Copy link
Contributor

CR + FR ok. APPROVED

vishalduggal added a commit that referenced this pull request May 7, 2015
[TIMOB-18765] iOS: Fix for uiimageview regression project name or file name has a space
@vishalduggal vishalduggal merged commit 89d57fc into tidev:master May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants