Essentials
Essentials copied to clipboard
[BUGFIX] Changed default MediaPicker image file format to JPEG on iOS
Description of Change
In Xamarin.Essentials on iOS, whenever the MediaPicker returns an image not represented by a file (mainly camera captures) it defaults to a PNG format in the result.
This is a very inefficient file format for camera images and inconsistent with Xamarin.Essential image capture behaviour on Android, UWP and Tizen, which all return JPEG formatted images by default.
This PR changes the result type for camera captures to JPEG for efficiency and to be consistent with the other platforms supported in Xamarin.Essentials.
Bugs Fixed
- Fixes issue #1697
API Changes
Added:
None
Changed:
None
Behavioral Changes
On iOS the FileResult returned by CapturePhotoAsync
is now a JPEG formatted image.
PR Checklist
- [X] Has tests (if omitted, state reason in description)
- [X] Has samples (if omitted, state reason in description)
- [X] Rebased on top of
main
at time of PR - [X] Changes adhere to coding standard
- [ ] Updated documentation (see walkthrough)
bump
- we are running into issues with too large files when capturing photo on iOS devices
another bump - quite a big issue for us :/
Not sure what the intended behavior for iOS is, but by using a PNG the file size is actually 4x larger than expected.
As this is a breaking change at this point, we won't be implementing this for Xamarin.Essentials anymore, thanks for all the time and effort here!