Open t30n3 opened 5 years ago
Hello, I'm using this plugin to resize images loaded via picker on a XF app. In Android, when I pick an image and execute the following code the image is correctly resized but it is also rotated.
using (IEditableImage image = await CrossImageEdit.Current.CreateImageAsync(stream)) { byte[] byteArray = await Task.Run(() => image.Resize(700).ToPng()); using (Stream outStream = File.OpenWrite(newFileName)) { outStream.Write(byteArray, 0, byteArray.Length); outStream.Flush(); outStream.Close(); } }
I also tried the following code but the result is the same:
byte[] byteArray; if (image.Width >= image.Height) byteArray = await Task.Run(() => image.Resize(700, 0).ToPng()); else byteArray = await Task.Run(() => image.Resize(0, 700).ToPng()); using (Stream outStream = File.OpenWrite(newFileName)) { outStream.Write(byteArray, 0, byteArray.Length); outStream.Flush(); outStream.Close(); }
Thanks in advance, Matteo
Hi @muak . May I know how to get an image path after rotated?
Code: someimage.rotate(90);
How to get this image?
Hello, I'm using this plugin to resize images loaded via picker on a XF app. In Android, when I pick an image and execute the following code the image is correctly resized but it is also rotated.
I also tried the following code but the result is the same:
Thanks in advance, Matteo