I am trying to fix 90 degrees rotation on iOS using the GetStreamWithImageRotatedForExternalStorage() method instead of GetStream().
The issue I have is that GetStream() works but return the image rotated, but when using GetStreamWithImageRotatedForExternalStorage() it returns an empty stream?
First I get the file using:
file = await CrossMedia.Current.PickPhotoAsync()
Then that file is passed to below method:
public static byte[] GetCropedImage(MediaFile file)
{
using (var inputStream = new SKManagedStream(file.GetStreamWithImageRotatedForExternalStorage()))
{
using (var original = SKBitmap.Decode(inputStream))
{
Here original is null?
}
}
}
I use the latest version of MediaPlugin 4.0.1.1 and SkiaSharp 1.60.2.
Both GetStream() and GetStreamWithImageRotatedForExternalStorage() works just fine on Android both with the image rotated correctly.
Anyone having an idea what I am doing wrong or are we talking about a bug?