|
@@ -128,7 +128,6 @@ namespace comal.timesheets
|
|
|
{
|
|
|
CompressionQuality = 15,
|
|
|
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Full,
|
|
|
- RotateImage = false
|
|
|
});
|
|
|
|
|
|
if (file == null)
|
|
@@ -160,7 +159,6 @@ namespace comal.timesheets
|
|
|
Name = filename,
|
|
|
CompressionQuality = 15,
|
|
|
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Full,
|
|
|
- RotateImage = true,
|
|
|
SaveMetaData = false
|
|
|
});
|
|
|
|
|
@@ -181,16 +179,13 @@ namespace comal.timesheets
|
|
|
using (await MaterialDialog.Instance.LoadingDialogAsync(message: "Adding Photo"))
|
|
|
{
|
|
|
var memoryStream = new MemoryStream();
|
|
|
- file.GetStream().CopyTo(memoryStream);
|
|
|
- var data = memoryStream.ToArray();
|
|
|
|
|
|
- //Document doc = new Document()
|
|
|
- //{
|
|
|
- // FileName = Path.GetFileName(file.Path),
|
|
|
- // Data = data,
|
|
|
- // CRC = CoreUtils.CalculateCRC(data),
|
|
|
- // TimeStamp = DateTime.Now
|
|
|
- //};
|
|
|
+ if (Device.RuntimePlatform.Equals(Device.Android))
|
|
|
+ file.GetStream().CopyTo(memoryStream);
|
|
|
+ else if (Device.RuntimePlatform.Equals(Device.iOS))
|
|
|
+ file.GetStreamWithImageRotatedForExternalStorage().CopyTo(memoryStream);
|
|
|
+
|
|
|
+ var data = memoryStream.ToArray();
|
|
|
|
|
|
DataToImage(data);
|
|
|
}
|