FFImageLoading icon indicating copy to clipboard operation
FFImageLoading copied to clipboard

Will not load Images in iOS - works perfect in Android

Open chuckgiddens opened this issue 5 years ago • 10 comments

🐛 Bug Report

It looks as if in iOS only, there are extra query strings/parameters being added to the URL I specify for the image

As you can see, your debug is reporting that it is trying to load: https://sportsopsstorage.blob.core.windows.net/comegowithme/cliques/icons/0b89a9cd-894f-45f3-b959-2cec8526b0aa_Thumbnail.jpg;CircleTransformation,borderSize=0,borderHexColor=

When it should be:https://sportsopsstorage.blob.core.windows.net/comegowithme/cliques/icons/0b89a9cd-894f-45f3-b959-2cec8526b0aa_Thumbnail.jpg

";CircleTransformation,borderSize=0,borderHexColor=" is being added to the end of every URL.

Crash Log: 2020-10-17 07:09:06.006 Xamarin.PreBuilt.iOS[3472:1894540] Image loading failed: https://sportsopsstorage.blob.core.windows.net/comegowithme/cliques/icons/0b89a9cd-894f-45f3-b959-2cec8526b0aa_Thumbnail.jpg;CircleTransformation,borderSize=0,borderHexColor= FFImageLoading.Exceptions.DownloadException: Zero length stream at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x006bd] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:174 at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58 at FFIma \projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21 at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618

geLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x000b2] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:24 at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededAsync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x00401] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:57 at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00045] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\UrlDataResolver.cs:22 at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:

Expected behavior

It should load the image from my Azure Storage

Reproduction steps

Simply create a Xamarin Forms project and run on iOS

Configuration

Windows Visual Studio 2019 Xamarin Forms 5.0/0/1558 Pre Release Version: 2.4.11.982

Platform:

  • [x ] :iphone: iOS
  • [ ] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms

chuckgiddens avatar Oct 17 '20 11:10 chuckgiddens

BTW, if I set DownsampleToViewSize to TRUE it also adds the size parameter to the URL. It does not appear to be happening for Android....just iOS

chuckgiddens avatar Oct 17 '20 11:10 chuckgiddens

Downgraded to latest XF 4.8 and it works. So seems like it is just an issue with the new XF 5.x Prerelease.

chuckgiddens avatar Oct 17 '20 13:10 chuckgiddens

Fixed by downgrading XF to 4.8

chuckgiddens avatar Oct 17 '20 13:10 chuckgiddens

Sorry, now it is quit working again. Still cannot see images in iOS because it is corrupting the URL with extra parameters and query strings. I thought it was because of XF 5.x Prerelease but this is now happening in XF 4.8

chuckgiddens avatar Oct 17 '20 14:10 chuckgiddens

Any suggestions on where I should look? Is no one else having issues with iOS? No matter what I try, it simple fails with a Zero Length stream.

I tried to download the source and add to my code but you have some compile bugs in your GifHelperBase.cs that is causing the current Master branch not to compile. "_previousImage" is of a type that !+ cannot be applied to default. So I commented that all our since I dont use GIFs anyway but I still cannot get your Samples to compile.

chuckgiddens avatar Oct 19 '20 16:10 chuckgiddens

Hello?

chuckgiddens avatar Oct 20 '20 23:10 chuckgiddens

Having the same issue here on iOS , works perfectly on android though

EddieNoureddine avatar Nov 07 '20 15:11 EddieNoureddine

Having the same exact issue: Xamarin.PreBuilt.iOS[18834:3798381] Image loading failed: https://coconapp.blob.core.windows.net/company-1/Assets/Logo.jpg;CircleTransformation,borderSize=20,borderHexColor=#07ADD3 FFImageLoading.Exceptions.DownloadException: Zero length stream Xamarin.Forms version 4.8.0.1687 with Hot Reload enabled. Haven't tried any other version though..

emreertugrul avatar Nov 14 '20 14:11 emreertugrul

Just a quick note, found out this happens only while using the xam hot reload. It does not happen on production builds, so I'm guessing it's a problem with the hot reload. In fact, there are other libraries who also don't play along well with hot reload at the moment...

emreertugrul avatar Nov 15 '20 13:11 emreertugrul

I'm having this issue with release builds on iOS. With Android and debug iOS builds all is good. Although the crash report shows

Image loading failed: https://xafaxpaymentapi20190520.azurewebsites.net/api/v3/locations/149/image;CircleTransformation,borderSize=0,borderHexColor= FFImageLoading.Exceptions.DownloadException: Zero length stream at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x006bd] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:174 at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58 at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x000b2] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:24 at FFImag<…>

When I check on the server I can see that the request was made to the correct address. There is no appending of the ';CircleTransformation,borderSize=0,borderHexColor=' to the request. I guess this is just added to the crash report.

abailie avatar May 03 '21 12:05 abailie