luberda-molinet / FFImageLoading

Image loading, caching & transforming library for Xamarin and Windows
MIT License
1.42k stars 377 forks source link

Xamarin Android Image loading URL failed #1302

Open Firice opened 5 years ago

Firice commented 5 years ago

Description

I using CachedImage binding link url, format JPG. IOS is everything ok but Android image loading fail

<ffImageLoading:CachedImage Grid.Row="0" Aspect="AspectFit" Source="{Binding Image}" />

Steps to Reproduce

Expected Behavior

Actual Behavior

System.BadImageFormatException: Not a valid bitmap at FFImageLoading.PlatformImageLoaderTask1[TImageView].GenerateImageFromDecoderContainerAsync (FFImageLoading.IDecodedImage1[TNativeImageContainer] decoded, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean isPlaceholder) [0x000ba] in C:\projects\ffimageloading\source\FFImageLoading.Droid\Work\PlatformImageLoadingTask.cs:221 at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].GenerateImageAsync (System.String path, FFImageLoading.Work.ImageSource source, System.IO.Stream imageData, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean enableTransformations, System.Boolean isPlaceholder) [0x002e2] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:360 at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x0047c] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:643 [skia] --- SkAndroidCodec::NewFromStream returned null [skia] --- SkAndroidCodec::NewFromStream returned null

Basic Information

Screenshots

Reproduction Link / Code

daniel-luberda commented 5 years ago

Could you give me the url which fails?

fsalash commented 5 years ago

I have the same issue.

XAML:

IMAGE CONVERTER: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { ImageSource retSource = null; if (value != null) { byte[] imageAsBytes = (byte[])value; retSource = StreamImageSource.FromStream(() => new MemoryStream(imageAsBytes)); } return retSource; } ERROR Image loading failed: ACEE2D1B0C5AD2C5770DD2A5DB987B75 System.BadImageFormatException: Not a valid bitmap at FFImageLoading.PlatformImageLoaderTask`1[TImageView].GenerateImageFromDecoderContainerAsync (FFImageLoading.IDecodedImage`1[TNativeImageContainer] decoded, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean isPlaceholder) [0x000ba] in C:\projects\ffimageloading\source\FFImageLoading.Droid\Work\PlatformImageLoadingTask.cs:221 at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].GenerateImageAsync (System.String path, FFImageLoading.Work.ImageSource source, System.IO.Stream imageData, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean enableTransformations, System.Boolean isPlaceholder) [0x002e2] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:360 at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x0047c] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:643 MY IMAGE BYTE[] : iVBORw0KGgoAAAANSUhEUgAAACMAAAAPCAYAAABut3YUAAAEGWlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy3YBevqRHz/qWh72Yui3MUDEL3q44WPXw3M+fo1pZuQs4tOIBVVTaoiXEI/MxfhGDPsxsNZfoE1q66ro5aJim3XdoLFw72H+n23BaIXzbcOnz5mfPoTvYVz7KzUl5+FRxEuqkp9G/Ajia219thzg25abkRE/BpDc3pqvphHvRFys2weqvp+krbWKIX7nhDbzLOItiM8358pTwdirqpPFnMF2xLc1WvLyOwTAibpbmvHHcvttU57y5+XqNZrLe3lE/Pq8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/ABApllUi6et9AAAAAElFTkSuQmCC I tried to decode byte[] in https://codebeautify.org/base64-to-image-converter and show the image!