av.imageview icon indicating copy to clipboard operation
av.imageview copied to clipboard

Invalid URL

Open macasfaj opened this issue 3 years ago • 2 comments

Hi there! I'm testing this imagelink:

https://upload.wikimedia.org/wikipedia/commons/e/e8/Barry_Edward_O%27Meara,_holding_a_copy_of_his_book,_A_Voice_From_St.Helena%281822%29.jpg

And it doesn't work... :/

I'm using iOS 2.0.2 module and Ti SDK 9.0.3.GA

But it works 100% if I use standard ImageView.

Any idea? Thanks!

macasfaj avatar Aug 13 '20 16:08 macasfaj

It's the URL encoding. Use https://upload.wikimedia.org/wikipedia/commons/e/e8/Barry_Edward_O'Meara,_holding_a_copy_of_his_book,_A_Voice_From_St._Helena_(1822).jpg and it works

m1ga avatar Aug 15 '20 13:08 m1ga

The current URL encoding using stringByAddingPercentEscapesUsingEncoding does have a negative impact on certain image urls that e.g. include %2F as encoding of /.

A valid sample of this is when using "subfolders" in Firebase, since Firebase doesn't actually use folders but instead add a reference in the url using subfolder%2FimageName. The URL encoding in the modules results in %2F being encoded to %252F which will result in a bad url (404).

As a quick fix I just removedstringByAddingPercentEscapesUsingEncoding from the code, but as a long term fix it would be great to add a property for optional encoding (e.g. urlEncode: true/false).

gjerlow avatar Nov 02 '20 15:11 gjerlow