av.imageview
av.imageview copied to clipboard
Invalid URL
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!
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
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).