Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have a BMP image in a memory stream, when I use the following code in Android I get the following error reported:
[skia] --- decoder->decode returned false
Here is the code:
TestImage.Source = ImageSource.FromStream(() => newImage);
If I write the memory stream out to a temp file and load the same image from a file it works using the following:
string tempFile = await WriteToTempFile(newImage);
TestImage.Source = ImageSource.FromFile(tempFile);
Note that iOS works just done using a memory stream for the same image!
The problem appears to be a known bug in Android that could easily be solved if the underlying Xamarin code implements the FlushedInputStream solution at https://github.com/nostra13/Android-Universal-Image-Loader/blob/master/library/src/com/nostra13/universalimageloader/core/assist/FlushedInputStream.java
Note there is a forum post about this and JPG and PNG but it also applies to BMP - this post is http://forums.xamarin.com/discussion/16500/bitmap-decode-byte-array-skia-decoder-returns-false
So my cross-platform PCL file ha sot use PCLStorage to write to a temp dil even on platforms that don't have the problem - not ideal.
Sorry about my last para (I blame the glass of red wine I just had :-), it should have read:
So my cross-platform PCL file has to use PCLStorage to write to a temp file even on platforms that don't have the problem - not ideal.
I have tried to reproduce this issue and unable to reproduce it. Could you please provide us the sample project or environment info to reproduce this issue ?.
Created attachment 7953 [details]
Xamarin.Forms page that shows the problem
Note: On the most recent version of Android (I'm using the Google Nexus simulator) the attached example works.
However, on a real HTC Desire C running Android 4.0.3 it fails, it also fails on other devices too.
So, maybe Google have fixed the bug in the most recent version of Android (?) but of course that accounts for a small percentage of the user base who generally are using older versions of Android.
I have checked this issue with given sample on Comment 3 and observed the different behavior on iOS and Android.
IDE Log: https://gist.github.com/saurabh360/0e0b59d076fb64b5570e
=== Xamarin Studio ===
Version 5.3 (build 440)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Mono 3.8.0 ((no/45d0ba1)
GTK+ 2.24.23 (Raleigh theme)
Package version: 308000009
=== Apple Developer Tools ===
Xcode 5.1 (5084)
=== Xamarin.Mac ===
Version: 184.108.40.206 (Business Edition)
=== Xamarin.Android ===
Version: 4.16.0 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
3.2 (API level 13)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
=== Xamarin.iOS ===
Version: 220.127.116.11 (Business Edition)
Build date: 2014-08-26 07:59:55-0400
=== Build Information ===
Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859
=== Operating System ===
Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
Tue Jun 3 21:27:35 PDT 2014
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description.
The App.cs file doesn't refer to any code using ImageSource.FromStream.
If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there.
Xamarin Forms Team
I am also running into this exact issue. I will try to reproduce in the next few weeks. Cheers!
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Xamarin Forms Team