Ffimageloading: Android XML vector drawables support

Created on 1 Oct 2018  路  8Comments  路  Source: luberda-molinet/FFImageLoading

Image in Xamarin.Forms supports specifying a source without an extension. This picks up *.xml on Android (vector drawables) and *.pdf on iOS. It lacks downsampling and this is why I tried FFImageLoading but I cannot use it because of this bug.

Android help wanted up-for-grabs

Most helpful comment

I think this feature should still be added it looks like the PR was cancelled due to Xamarin.Forms base image handling it but Xamarin Forms Image Control does not cache the image and i would like to utilize best of both worlds.

All 8 comments

I'm not sure which is your bug but I'm able to load a *.pdf on iOS using ffimageloading:CachedImage in Source and even in LoadingPlaceholder and ErrorPlaceholder.
Take into account that this is only available on iOS >= 9.0

@fedemkr this is good but how about Android vector drawables?

No, that doesn't work yet (I haven't tested with FFImageLoading.SVG but AFAIK it works only with *.svg files).

E.g. If you attemp to load one Android vector drawable named ic_document_history it throws:

Image loading failed: ic_document_history.xml;157x0
System.BadImageFormatException: Not a valid bitmap
  at FFImageLoading.PlatformImageLoaderTask`1[TImageView].GenerateImageFromDecoderContainerAsync (FFImageLoading.IDecodedImage`1[TNativeImageContainer] decoded, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean isPlaceholder) [0x000a8] in C:\projects\ffimageloading\source\FFImageLoading.Droid\Work\PlatformImageLoadingTask.cs:215 
  at FFImageLoading.Work.ImageLoaderTask`3+<GenerateImageAsync>d__104[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x002c4] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:307 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0 
  at FFImageLoading.Work.ImageLoaderTask`3+<RunAsync>d__109[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x004ae] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:588 

This is quite unfortunate. Is this feature planned?

There is another issue that was discussing Android XML Support. Please check #891

Thank you. So, is #891 going to be fixed and when, please? I can see there's a PR to it, is there any reason it isn't merged?

There was a PR with vector support https://github.com/luberda-molinet/FFImageLoading/issues/891

but there were some changes in codebase since, anyone want to merge it?

I think this feature should still be added it looks like the PR was cancelled due to Xamarin.Forms base image handling it but Xamarin Forms Image Control does not cache the image and i would like to utilize best of both worlds.

Was this page helpful?
0 / 5 - 0 ratings