-
-
Notifications
You must be signed in to change notification settings - Fork 361
The parameters to modify the size of the image are not working in android #553
Comments
I am also in need of the MaxWidtHeight functionality, so I had a look in the code to see if this was implemented. There seems to be some code missing in a certain code path, both for PickMediaAsync and TakeMediaAsync:
The FixOrientationAndResizeAsync seems to have an implementation for MaxWidthHeight, but the ResizeAsync is missing this logic. Specifically this part seems to be missing in de ResizeAsync:
I just did a quick test with current version of nuget package 4.0.0.9, and if I set RotateImage = true, the resizing works. If I set RotateImage = false, it fails to resize the image. |
They also don't seem to be working on iOS. I'm going to have a crack and it and see if I can find why. EDIT: I've tried adding the projects csporj to my Xamarin.Forms project, couldn't compile even targeting iOS because it hates the Android support libraries this brings in. Tried directly in iOS app, same issues. Tried even running the Media.sln to try build a dll and I get a whole bunch of
I'm more than happy to look into and try fix these issues for iOS and Android as I've done a heap of image processing on them both natively, but I have no idea of how to even run this project to get started :( |
Fixed |
the method is not changing the size of the image using the available parameters,
Bug Information
Version Number of Plugin: 4.0.0.9
Device Tested On: Motorola Z2 Play
Simulator Tested On:
Version of VS: 15.7.1
Version of Xamarin: 3.0.0.482510
Versions of other things you are using:
Steps to reproduce the Behavior
Using CrossMedia.Current.TakePhotoAsync() method is saving the image in max quality and max size without taken effect any of the options
Expected Behavior
image should get resized
Actual Behavior
the parameters to resize the image are not working
Code snippet
var foto = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions() { SaveToAlbum = true, PhotoSize = Plugin.Media.Abstractions.PhotoSize.MaxWidthHeight, SaveMetaData = false, MaxWidthHeight = 800, });
The text was updated successfully, but these errors were encountered: